const {PassThrough} = require('stream')
const fs = require('fs')
const d = new PassThrough()
fs.createReadStream('tt2.js').pipe(d) // can be piped from reaable stream
d.pipe(process.stdout) // can pipe to writable stream
d.on('data', console.log) // also like readable
Forked from bowin/node.js PassThrough stream.md
Created
January 25, 2019 17:57
Node.js Stream PassThrough Usage
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment