-
-
Notifications
You must be signed in to change notification settings - Fork 14
Home
This is the home of the 4.x version. Upgrading from 3.x? See the Migration guide. The home for 2.x is here.
stream-chain builds object-processing pipelines from plain functions, generators, and existing streams — handling backpressure for you — on Node streams, Web streams, or neither. This page routes you to the right doc; for the 30-second pitch, see the README.
🔍 Search this wiki — ranked, deep-linked search via wiki-search; install the bookmarklet to search in place. Fallback: GitHub wiki search.
New to stream-chain? Read in this order, then dip into the reference sections below:
- Concepts — the model (one input → zero-to-many outputs), why streams, and how performance shaped the design.
- Intro by examples — those concepts as runnable pipelines; the quickest way to see how it feels.
- Performance — once it works, how to keep it fast and how to package reusable components.
-
chain() — the heart of the package (imported as
stream-chain). Choose a substrate by import path:-
stream-chain/stream-chain/node— Node streams (default). -
stream-chain/web— native Web streams; browser-safe. -
stream-chain/core— substrate-free async iterables; the leanest option.
-
- Transducers — compose functions into one fused stage:
-
Adapters — wrap a function as a standalone stream:
-
asStream() — Node
Duplex. -
asWebStream() — Web
{readable, writable}pair.
-
asStream() — Node
-
defs — the special values (
none,stop,many,finalValue, flushable) and stream type guards.
-
JSONL — batteries-included object I/O: parser / stringer for both substrates, plus the fused
parseFile/stringerToFilefile-edge composites. -
utils — the helper catalog: slicing (
take/skip/ …), folding (fold/scan/reduceStream), stream adapters (readableFrom, …), line / UTF-8 / batch helpers, block file I/O, and thepipe/draindrivers. -
streamPuller / webStreamPuller — consume a Node
Readable/ WebReadableStreamas a non-destructive async iterator.
For when it already works and you want more speed or more leverage:
- highWaterMark — tuning flow and backpressure.
- Benchmarks — how performance is measured, and how to run them.
- Typed streams — the TypeScript machinery behind pipeline I/O types.
- Release notes — the changelog.
Start here
API
Transducers
Adapters
I/O & helpers
Tuning & internals
Reference
stream-chain 2.x (legacy)