API reference
Operator index
Find the complete public API by intent. Every page covers signatures, accepted values and defaults, execution, pressure, memory, context, errors, cancellation, runtimes, forms, and edge cases that change real behavior.
Create
exstream()— adapt iterables, promises, platform streams, generators, or a writable sourcedefer()— create or acquire a source only when its graph is activatedfromEvent()— adapt hot EventTarget and EventEmitter sourcespipeline()— define a reusable typed operator chaindestination()— define a reusable terminal consumer with setup and cleanupdata()andnil— distinguish data from error and end control records
Context
withContext()andextendContext()— attach synchronous or asynchronous record metadata- Stream state — inspect lifecycle, buffering, drops, pressure, and cancellation
- Events — observe errors, aborts, completion, fatal failures, and drain
Transform
map(),flatMap(), andflatten()— reshape or expand valuestap()andcompact()— add synchronous effects or remove falsy valuespluck(),pick(), andomit()— reshape object recordsbatch()— group records into bounded arrays
Select
filter()andreject()— keep or drop by synchronous predicatefind(),where(), andfindWhere()— find by predicate or shallow object matchuniq()— retain the first value for each identity, selected key, or field tupleslice(),take(),drop(),head(), andlast()— select by positionstopWhen()— include the first match and stop the branch
Aggregate and order
collect()andreduce()— produce one result after completiongroupBy()andkeyBy()— build a complete grouped or unique-key indexsort()— order a complete finite streamsortedGroupBy()— group adjacent equal keys without retaining the whole stream
Async work
mapAsync()— transform with concurrency, ordering, retry, local recovery, timeout, and cancellation controlsmakeAsync()— yield long synchronous pipelines to the event loop
Flow control
throttle()— drop values inside a time windowrateLimit()— delay values to enforce a local burst rate
Branch and combine
fork()— create a reliable branch participating in backpressureobserve()— create a non-blocking, explicitly buffered observermerge()— consume a stream of streams with bounded concurrencythrough()— attach a pipeline, function, or Node transformsortedJoin()— merge-join exactly two pre-sorted streams
Errors
- Error API — inspect record metadata, provenance, format errors, overflow, and timeouts
errors()andskipErrors()— recover, replace, or drop record errorsfailOnError()andstopOnError()— promote or stop at the first record errorrouteErrors()— split data and dead letters into reliable branches
Formats
csv()andcsvStringify()— incremental CSV parsing and serializationjson()andjsonStringify()— stream one JSON document or array envelopejsonl()andjsonlStringify()— parse and serialize line-delimited JSONsplit()— decode and tokenize lines or custom regular-expression-delimited text across chunk boundariesencode()anddecode()— transform streaming base64
Consume
pipeTo()— run an Exstream destination or write to a Node or Web writablefor await...of— consume one value at a timetoArray(),single(), anddrain()— finish with uniform promise semantics
Interop
toWebReadable()andtoNodeReadable()— expose platform readables from a source-backed ExstreamtoNodeTransform()— expose a reusable pipeline as a native Node transform
Low-level API
write()andend()— implement manual sourcesconsume()andconsumeSync()— build custom operatorsstart()— freeze and activate an explicitly gated source graph