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 sourcefromEvent()— adapt hot EventTarget and EventEmitter sourcespipeline()— define a reusable typed operator chaindata()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()anduniqBy()— retain the first value for each identity or keyslice(),take(),drop(),head(), andlast()— select by positionstopWhen()— include the first match and stop the branch
Aggregate and order
collect(),reduce(), andreduce1()— produce one result after completiongroupBy()andkeyBy()— build a complete grouped or unique-key indexsort()andsortBy()— order a complete finite streamsortedGroupBy()— group adjacent equal keys without retaining the whole stream
Async work
mapAsync()— transform with concurrency, ordering, retry, timeout, and cancellation controlsasyncFilter()andasyncReduce()— await sequential selection or aggregationresolve(),massThen(), andmassCatch()— work with streams of promisesmakeAsync()— yield long synchronous pipelines to the event loop
Flow control
throttle()— drop values inside a time windowratelimit()— delay values to enforce a maximum 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 parallelismthrough()— attach a pipeline, stream, 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()andsplitBy()— decode and tokenize text across chunk boundariesencode()anddecode()— transform streaming base64
Consume
pipe()andpipeTo()— connect a destination with native or promise completion semanticstoAsyncIterator()— consume one value perfor awaitdemandtoWebReadable()andtoNodeStream()— expose platform streamstoArray(),toPromise(), anddrain()— finish through callbacks or promisesvalue(),values(), andvaluesSync()— collect with cardinality or synchrony checks
Low-level API
write(),writeData(), andpull()— implement manual sources and demandconsume(),consumeSync(), andeach()— build custom operators or callback terminalsstart(),pause(), andresume()— control source gates and adaptersend(),destroy(),abort(), andfail()— choose the correct terminal transitionextend()and Utilities — extend the prototype or reuse exported helpers