A flatten function for Web Streams
npm install s-flattenA flatten function for Web Streams. Like Array.prototype.flat(), but for Web Streams.
``bash`
npm install s-flatten
`js
import sFlatten from "s-flatten";
const stream = ReadableStream.from([
[1, 2],
[3, 4],
]).pipeThrough(sFlatten());
const result = await Array.fromAsync(stream);
console.log(result); // [1, 2, 3, 4]
`
Returns a TransformStream
- s-batch - Batch items in a stream
- s-compose - Compose streams together