Socket
Book a DemoInstallSign in
Socket

duplex-combination

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

duplex-combination - npm Package Compare versions

Comparing version

to
1.1.0

16

dc.js

@@ -17,4 +17,4 @@ "use strict";

this._reader = reader;
this._writer = writer;
this.reader = reader;
this.writer = writer;
Duplex.call(this, options);

@@ -25,7 +25,7 @@

var duplex = this;
this._reader.on('error', function (error) {
duplex.emit('error', error);
this.reader.on('error', function (error) {
duplex.emit('error', error, duplex.reader);
});
this._writer.on('error', function (error) {
duplex.emit('error', error);
this.writer.on('error', function (error) {
duplex.emit('error', error, duplex.writer);
});

@@ -41,4 +41,4 @@

assert(writer instanceof stream.Writable || writer instanceof stream.Duplex, 'writer must be a Writable stream');
this._reader.read(0);
this._writer.read(0);
this.reader.read(0);
this.writer.read(0);
};

@@ -45,0 +45,0 @@

{
"name": "duplex-combination",
"description": "Combine a readable and writable stream into a duplex stream",
"version": "1.0.1",
"version": "1.1.0",
"license": "BSD",

@@ -6,0 +6,0 @@ "scripts": {

@@ -16,4 +16,23 @@ # duplex-combination

## Additional public properties
The read and write streams are exposed with the properties `dp.reader` and `dp.writer`
## ERRORS
Error events include the stream that triggered the error, so you can:
```javascript
dp.on('error',function(err,stream) {
if (stream === dp.reader) {
// error while reading
}
else {
// error while writing
}
});
```
## Acknowledgements
Stolen shamelessly from Isaac Schuleter's `duplex-passthrough` module.
SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.