stream-connect
Connect two streams returning a single duplex stream. Use over .pipe()
when you want to write to the source stream yet read from the destination.
Example
const connect = require('stream-connect')
function streamsOneAndTwo () {
const streamOne = getStreamOneSomehow()
const streamTwo = getStreamTwoSomehow()
const streamsOneAndTwo = connect(streamOne(), streamTwo())
}
fs.createReadStream('main.js')
.pipe(streamsOneAndTwo())
.pipe(process.stdout)
connect(one, two) ⇒ Duplex
⏏
Connects two streams together.
Kind: Exported function
Param | Type | Description |
---|
one | Duplex | source stream |
two | Duplex | dest stream, to be connected to |
© 2015 Lloyd Brookes <75pound@gmail.com>. Documented by jsdoc-to-markdown.