fwd-stream
Forward a readable stream to another readable stream or a writable stream to another writable stream. Featuring streams2 support and async instantiating.
npm install fwd-stream
When should I use this?
This module makes it easy to return a stream synchroniously that wraps another stream from an async context. Say for example you wanted to create a folder before writing a write you could do
var fs = ;var fwd = ;var ws = fwd;ws;
Usage
Forward readable streams
var fwd = ;// rs will be a stream that forwards someReadableStream's data and events// backpressure etc will still be respectedvar rs = fwd;// or using async instantiatingvar rs = fwd;// or using objectModevar rs = fwd;
Forward writable streams
var ws = fwd;// or using async instantiatingvar ws = fwd;// or using objectModevar ws = fwd;
Forward duplex streams
var dupl = fwd;// or using async instantiatingvar dupl = fwd;// or using objectModevar dupl = fwd;
License
MIT