Socket
Socket
Sign inDemoInstall

pump

Package Overview
Dependencies
1
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.0 to 0.1.1

10

index.js
var once = require('once');
var noop = function() {};
var patch = function(stream, onend) { // patch 0.8 stream since they dont emit finish
var end = stream.end;
stream.end = function() {
onend();
end.apply(this, arguments);
};
};
var destroyer = function(stream, callback) {

@@ -33,2 +41,4 @@ var ended = false;

if (!stream._readableState && stream.writable) patch(stream, onend);
return destroy;

@@ -35,0 +45,0 @@ };

2

package.json
{
"name": "pump",
"version": "0.1.0",
"version": "0.1.1",
"repository": "git://github.com/mafintosh/pump.git",

@@ -5,0 +5,0 @@ "license": "MIT",

# pump
pump is a small node module that pipes streams together and destroy them if one of them closes.
pump is a small node module that pipes streams together and destroys all of them if one of them closes.
npm install pump
## What problem does it solve?
When using standard `source.pipe(dest)` source will _not_ be destroyed if dest emits close or an error.

@@ -46,2 +48,2 @@ You are also not able to provide a callback to tell when then pipe has finished.

MIT
MIT
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