duplexify
Advanced tools
Comparing version 3.2.0 to 3.3.0
@@ -40,2 +40,3 @@ var stream = require('readable-stream') | ||
this._forwardDestroy = !opts || opts.destroy !== false | ||
this._forwardEnd = !opts || opts.end !== false | ||
this._corked = 1 // start corked | ||
@@ -86,3 +87,3 @@ this._ondrain = null | ||
var self = this | ||
var unend = eos(writable, {writable:true, readable:false}, destroyer(this, true)) | ||
var unend = eos(writable, {writable:true, readable:false}, destroyer(this, this._forwardEnd)) | ||
@@ -208,3 +209,3 @@ var ondrain = function() { | ||
onuncork(this, function() { | ||
end(self._writable, function() { | ||
end(self._forwardEnd && self._writable, function() { | ||
self.emit('prefinish') | ||
@@ -211,0 +212,0 @@ onuncork(self, cb) |
{ | ||
"name": "duplexify", | ||
"version": "3.2.0", | ||
"version": "3.3.0", | ||
"description": "Turn a writeable and readable stream into a streams2 duplex stream with support for async initialization and streams1/streams2 input", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -49,3 +49,4 @@ # duplexify | ||
If the readable or writable streams emits an error or close it will destroy both streams and bubble up the event. | ||
You can also explictly destroy the streams by calling `dup.destroy()` | ||
You can also explictly destroy the streams by calling `dup.destroy()`. The `destroy` method optionally takes an | ||
error object as argument, in which case the error is emitted as part of the `error` event. | ||
@@ -52,0 +53,0 @@ ``` js |
15523
394
93