Stream utility library for Node.js.
To use the functions in this library, import the @zingle/stream package into your project.
import stream from "@zingle/stream";
filter(filterFunction, [streamOptions])
Use a filter stream to filter out stream data that fails to match a filter. This is analogous to Array.prototype.filter.
import stream from "@zingle/stream";
getReadableSomehow().pipe(stream.filter((chunk, enc) => {
return chunk.toString("utf8") !== "null";
}));
flatten([streamOptions])
Use a flatten stream to flatten stream Array data before passing it along. This is analogous to Array.prototype.flat.
import stream from "@zingle/stream";
getReadableSomehow().pipe(stream.flatten());
map(mapFunction, [streamOptions])
Use a map stream to perform a one-to-one mapping of stream data using a map function. This is analogous to Array.prototype.map.
import stream from "@zingle/stream";
getReadableSomehow().pipe(stream.map((chunk, enc) => {
return chunk.toString("utf8").toUpperCase();
}));