Creating a Node.js stream from two piped streams
问题 I'd like to combine two Node.js streams into one by piping them, if possible. I'm using Transform streams. In other words, I'd like my library to return myStream for people to use. For example they could write: process.stdin.pipe(myStream).pipe(process.stdout); And internally I'm using a third-party vendorStream that does some work, plugged into my own logic contained in myInternalStream . So what's above would translate to: process.stdin.pipe(vendorStream).pipe(myInternalStream).pipe(process