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

end-of-stream

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

end-of-stream - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

20

index.js

@@ -5,8 +5,4 @@ var once = require('once');

var patch = function(stream, fn) { // ensure a 'finish' event - even for 0.8 streams
var end = stream.end;
stream.end = function() {
fn();
end.apply(this, arguments);
};
var isRequest = function(stream) {
return stream.setHeader && typeof stream.abort === 'function';
};

@@ -25,2 +21,6 @@

var onlegacyfinish = function() {
if (!stream.writable) onfinish();
};
var onfinish = function() {

@@ -41,3 +41,9 @@ writable = false;

if (writable && !ws) patch(stream, onfinish);
if (isRequest(stream)) {
stream.on('complete', onfinish);
stream.on('abort', onclose);
} else if (writable && !ws) { // legacy streams
stream.on('end', onlegacyfinish);
stream.on('close', onlegacyfinish);
}

@@ -44,0 +50,0 @@ stream.on('end', onend);

{
"name": "end-of-stream",
"version": "0.1.0",
"version": "0.1.1",
"description": "Call a callback when a readable/writable/duplex stream has completed or failed.",

@@ -5,0 +5,0 @@ "repository": "git://github.com/mafintosh/end-of-stream.git",

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