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

pipe-io

Package Overview
Dependencies
Maintainers
1
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pipe-io - npm Package Compare versions

Comparing version 2.0.2 to 2.0.3

56

legacy/pipe.js
'use strict';
var fs = require('fs');
var zlib = require('zlib');

@@ -56,20 +55,12 @@ var assert = require('assert');

callWhenOpen(write, function (e) {
if (e) {
onWriteError(e);
read.on('readable', function () {
read.resume();
});
}
if (end && readError)
{ return onEnd(); }
open = true;
write.on('error', onWriteError);
setListeners(streams, onError);
fullPipe(allStreams, options);
read.on('readable', function () {
read.resume();
});
open = true;
write.on('error', onWriteError);
setListeners(streams, onError);
fullPipe(allStreams, options);
function onWriteError(error) {

@@ -88,3 +79,3 @@ writeError = true;

}
function onReadEnd() {

@@ -94,3 +85,3 @@ end = true;

}
function onWriteFinish() {

@@ -135,29 +126,2 @@ finish = true;

/*
* when stream is fs.WriteStream
* finish event could be emitted before
* open and then everything crash
*/
function callWhenOpen(stream, fn) {
var isFsWrite = stream instanceof fs.WriteStream;
var on = function (error) {
var isError = error instanceof Error;
stream.removeListener('open', on);
stream.removeListener('error', on);
if (isError)
{ fn(error); }
else
{ fn(); }
};
if (!isFsWrite) {
fn();
} else {
stream.on('open', on);
stream.on('error', on);
}
}
function fullPipe(streams, options) {

@@ -164,0 +128,0 @@ var main;

'use strict';
const fs = require('fs');
const zlib = require('zlib');

@@ -56,20 +55,12 @@ const assert = require('assert');

callWhenOpen(write, (e) => {
if (e) {
onWriteError(e);
read.on('readable', () => {
read.resume();
});
}
if (end && readError)
return onEnd();
open = true;
write.on('error', onWriteError);
setListeners(streams, onError);
fullPipe(allStreams, options);
read.on('readable', () => {
read.resume();
});
open = true;
write.on('error', onWriteError);
setListeners(streams, onError);
fullPipe(allStreams, options);
function onWriteError(error) {

@@ -88,3 +79,3 @@ writeError = true;

}
function onReadEnd() {

@@ -94,3 +85,3 @@ end = true;

}
function onWriteFinish() {

@@ -135,29 +126,2 @@ finish = true;

/*
* when stream is fs.WriteStream
* finish event could be emitted before
* open and then everything crash
*/
function callWhenOpen(stream, fn) {
const isFsWrite = stream instanceof fs.WriteStream;
const on = (error) => {
const isError = error instanceof Error;
stream.removeListener('open', on);
stream.removeListener('error', on);
if (isError)
fn(error);
else
fn();
};
if (!isFsWrite) {
fn();
} else {
stream.on('open', on);
stream.on('error', on);
}
}
function fullPipe(streams, options) {

@@ -164,0 +128,0 @@ let main;

6

package.json
{
"name": "pipe-io",
"version": "2.0.2",
"version": "2.0.3",
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",

@@ -38,5 +38,5 @@ "description": "Pipe streams and handle events",

"coveralls": "^2.11.6",
"eslint": "^3.8.1",
"eslint": "^4.0.0",
"nodemon": "^1.11.0",
"nyc": "^10.0.0",
"nyc": "^11.0.2",
"pullout": "^1.0.1",

@@ -43,0 +43,0 @@ "redrun": "^5.9.2",

Sorry, the diff of this file is not supported yet

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