Last active
October 2, 2015 05:55
-
-
Save dhritzkiv/210976f47e8e9722a5a9 to your computer and use it in GitHub Desktop.
Chaining an arbitrary number of node.js Streams
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//readStream is a readable input stream; | |
//writeStream is a writable output stream; and | |
//transformStreamsArray is a predefined array with an arbitrary number of transform streams; | |
transformStreamsArray | |
.reduce((previousStream, thisStream) => previousStream.pipe(thisStream), readStream) | |
.pipe(writeStream); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment