API Reference
streamfu provides 22 functions organized in three categories.
Rule of thumb: If it returns a
ReadableStream, it’s non-consuming. If it returns aPromise, it consumes the stream.
Creation
Functions that create new streams from various data sources.
| Function | Description |
|---|---|
createReadable(iterable) |
|
createWritable(fn) |
|
range(min, max, step?) |
|
words(chars, length) |
Transformations (non-consuming)
These return a new ReadableStream — the original is not consumed.
Consumers (consuming)
These consume the stream and return a Promise — it cannot be reused afterward. Use branch() first if you need to consume a stream multiple times.
| Function | Description |
|---|---|
reduce(stream, fn, init) |
|
list(stream) |
|
at(stream, index) |
|
some(stream, fn) |
|
every(stream, fn) |
|
forEach(stream, fn) |
|
includes(stream, value) |
|
indexOf(stream, value) |