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 1.0.0 to 1.1.0

LICENSE

11

index.js

@@ -9,2 +9,6 @@ var once = require('once');

var isChildProcess = function(stream) {
return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3
};
var eos = function(stream, opts, callback) {

@@ -35,2 +39,6 @@ if (typeof opts === 'function') return eos(stream, null, opts);

var onexit = function(exitCode) {
callback(exitCode ? new Error('exited with error code: ' + exitCode) : null);
};
var onclose = function() {

@@ -55,2 +63,4 @@ if (readable && !(rs && rs.ended)) return callback(new Error('premature close'));

if (isChildProcess(stream)) stream.on('exit', onexit);
stream.on('end', onend);

@@ -69,2 +79,3 @@ stream.on('finish', onfinish);

stream.removeListener('finish', onfinish);
stream.removeListener('exit', onexit);
stream.removeListener('end', onend);

@@ -71,0 +82,0 @@ stream.removeListener('error', callback);

2

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

@@ -5,0 +5,0 @@ "repository": {

var assert = require('assert');
var eos = require('./index');
var expected = 6;
var expected = 8;
var fs = require('fs');
var cp = require('child_process');
var net = require('net');

@@ -38,2 +39,16 @@

var exec = cp.exec('echo hello world');
eos(exec, function(err) {
expected--;
assert(!err);
if (!expected) process.exit(0);
});
var spawn = cp.spawn('echo', ['hello world']);
eos(spawn, function(err) {
expected--;
assert(!err);
if (!expected) process.exit(0);
});
var socket = net.connect(50000);

@@ -40,0 +55,0 @@ eos(socket, function(err) {

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