Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

duplexify

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

duplexify - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

29

index.js

@@ -5,2 +5,4 @@ var eos = require('end-of-stream')

var noop = function() {}
var onclose = function(self) {

@@ -16,2 +18,3 @@ return function(err) {

this.destroyed = false
this._destroy = !opts || opts.destroy !== false

@@ -71,3 +74,3 @@ this._writable = null

if (writable === null) {
stream.Writable.prototype.end.call(this)
this._finish(noop)
return

@@ -103,4 +106,6 @@ }

if (this._readable && this._readable.destroy) this._readable.destroy()
if (this._writable && this._writable.destroy) this._writable.destroy()
if (this._destroy) {
if (this._readable && this._readable.destroy) this._readable.destroy()
if (this._writable && this._writable.destroy) this._writable.destroy()
}

@@ -115,2 +120,11 @@ this.emit('close')

Duplexify.prototype._finish = function() {
var self = this
var end = function() {
stream.Writable.prototype.end.call(self)
}
if (!this.emit('prefinish', end)) end()
}
Duplexify.prototype._forward = function() {

@@ -147,3 +161,3 @@ if (this._forwarding || !this._readable2 || !this._drained) return

var end = function() {
stream.Writable.prototype.end.call(self, cb)
self._finish(cb)
}

@@ -176,4 +190,7 @@

module.exports.obj = function(writable, readable) {
return new Duplexify(writable, readable, {objectMode:true, highWaterMark:16})
module.exports.obj = function(writable, readable, opts) {
if (!opts) opts = {}
opts.objectMode = true
opts.highWaterMark = 16
return new Duplexify(writable, readable, opts)
}
{
"name": "duplexify",
"version": "1.1.0",
"version": "1.2.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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc