duplexer2-unwrappable
Like duplexer2 but unwrappable
var stream = ; var duplexer2 = ; var writable = objectMode: true readable = objectMode: true; writable { if readable return ; else readable; }; readable { // no-op}; // simulate the readable thing closing after a bitwritable; var duplex = ; duplex; duplex; duplex; duplex; duplex;
got data "oh, hi there"
finished writing
got finish event
finished ending
got end event
Overview
This is a reimplementation of duplexer using the Streams3 API which is standard in Node as of v4. Everything largely works the same.
Installation
$ npm i duplexer2-unwrappable
API
duplexer2
Creates a new DuplexWrapper
object, which is the actual class that implements
most of the fun stuff. All that fun stuff is hidden. DON'T LOOK. now exposed so you can unwrap streams and avoid having closures bind streams together forever.
options writable readable
const duplex = ;
Arguments
- options - an object specifying the regular
stream.Duplex
options, as well as the properties described below. - writable - a writable stream
- readable - a readable stream
Options
- bubbleErrors - a boolean value that specifies whether to bubble errors
from the underlying readable/writable streams. Default is
true
.
Instance Methods
- unbind - unbinds the duplexer2 instance from the writable and readable stream methods, allowing the underlying streams to be re-used.
License
3-clause BSD. A copy is included with the source.
Contact
-
GitHub (deoxxa)
-
Twitter (@deoxxa)
-
Email (deoxxa@fknsrs.biz)