API Reference
streamfu provides 23 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.