Socket
Socket
Sign inDemoInstall

pumpify

Package Overview
Dependencies
14
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.3 to 1.2.0

23

index.js
var pump = require('pump')
var util = require('util')
var duplexify = require('duplexify')
var Duplexify = require('duplexify')

@@ -14,19 +14,12 @@ var toArray = function(arguments) {

if (!(this instanceof Pumpify)) return new Pumpify(streams)
duplexify.call(this, null, null, opts)
this._onflush = null
this._flushed = false
Duplexify.call(this, null, null, opts)
if (streams.length) this.setPipeline(streams)
}
util.inherits(Pumpify, duplexify)
util.inherits(Pumpify, Duplexify)
Pumpify.prototype._flush = function(cb) {
if (this._flushed) return cb()
this._onflush = cb
}
Pumpify.prototype.setPipeline = function() {
var streams = toArray(arguments)
var self = this
var ended = false
var w = streams[0]

@@ -43,7 +36,11 @@ var r = streams[streams.length-1]

this.on('close', onclose)
this.on('prefinish', function() {
if (!ended) self.cork()
})
pump(streams, function(err) {
self.removeListener('close', onclose)
if (err) return self.destroy(err)
if (self._onflush) self._onflush()
self._flushed = true
ended = true
self.uncork()
})

@@ -50,0 +47,0 @@

{
"name": "pumpify",
"version": "1.1.3",
"version": "1.2.0",
"description": "Combine an array of streams into a single duplex stream using pump and duplexify",
"main": "index.js",
"dependencies": {
"duplexify": "^2.0.0",
"duplexify": "^3.0.0",
"pump": "^0.3.3"

@@ -9,0 +9,0 @@ },

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc