-
Notifications
You must be signed in to change notification settings - Fork 2
Release notes
ESM ("type": "module") — require() consumers must switch to import (or await import() from CJS).
Functional API. new Fork(...) from 1.x becomes fork(...) — no new, no class.
New primitives. route(outputs, options) (per-chunk single-target dispatch via options.pick) and filter(outputs, options) (per-chunk subset broadcast via options.predicates) alongside fork. Each returns a sink that gates upstream backpressure on the receiving downstreams' write completions.
Picker helpers under stream-fork/utils/: pickRoundRobin, pickByHash, pickByKey, pickFirstMatch. Compose with route for the common dispatch shapes.
Web Streams flavor at stream-fork/web. Same three primitives wrapping WritableStream. The Web fork is a backpressure-preserving generalization of ReadableStream.tee() to N outputs — unlike tee, no per-branch buffering.
Node 22+.
No functional changes; metadata only. Safe to skip.
- Errors from downstream streams are now forwarded correctly. Thanks to dbubovych.
Republished to support Node 14.
Switched from _final() to the 'finish' event so the package would work on Node 6.
Documentation polish; no behavior change.
First public release. A single Fork class — a Writable that broadcast every chunk to every output, with proper backpressure handling.