Skip to content

Conversation

@antongolub
Copy link
Collaborator

const $h = $({ halt: true })
const p1 = $`echo foo`
const p2 = $h`echo a && sleep 0.1 && echo c && sleep 0.2 && echo e`
const p3 = $h`sleep 0.05 && echo b && sleep 0.1 && echo d`
const p4 = $`sleep 0.4 && echo bar`
const p5 = $h`cat`

await p1
p1.pipe(p5)
p2.pipe(p5)
p3.pipe(p5)
p4.pipe(p5)

const { stdout } = await p5.run() // 'foo\na\nb\nc\nd\ne\nbar\n'
  • Tests pass
  • Appropriate changes to README are included in PR

This comment was marked as outdated.

@antongolub antongolub requested a review from Copilot July 31, 2025 18:54
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enables many-to-one piping functionality, allowing multiple processes to pipe their output to a single destination process. This enhances the existing pipe API to support merging multiple streams into one.

Key changes:

  • Introduces a static bus object to track pipe relationships between processes
  • Replaces simple _pipedFrom property with a more sophisticated piping system
  • Updates documentation with examples of the new many-to-one piping capability

Reviewed Changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/core.ts Implements the core many-to-one piping logic with static bus system
test/core.test.js Adds test case demonstrating multiple processes piping to one destination
test/export.test.js Updates export tests to include the new ProcessPromise.bus property
docs/process-promise.md Documents the new many-to-one piping feature with examples
src/versions.ts Updates version to 8.8.0
build/index.cjs, build/core.cjs Compiled output reflecting the changes
.size-limit.json Updates size limits to accommodate new functionality

@antongolub antongolub merged commit 38da212 into google:main Jul 31, 2025
48 of 49 checks passed
@antongolub antongolub deleted the enable-many-to-one-piping branch July 31, 2025 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant