🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

understream

Package Overview
Dependencies
Maintainers
4
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

understream - npm Package Compare versions

Comparing version

to
0.10.11

test/bin/fail_with_err

24

lib-js/transforms/process.js
// Generated by CoffeeScript 1.6.3
var Duplex, Process, _,
var Duplex, PassThrough, Process, _, _ref,
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },

@@ -9,3 +9,3 @@ __hasProp = {}.hasOwnProperty,

Duplex = require('stream').Duplex;
_ref = require('stream'), Duplex = _ref.Duplex, PassThrough = _ref.PassThrough;

@@ -19,2 +19,3 @@ module.exports = Process = (function(_super) {

this.process = process;
this._pipeline = __bind(this._pipeline, this);
this.pipe = __bind(this.pipe, this);

@@ -27,8 +28,25 @@ Process.__super__.constructor.call(this, _(this.stream_opts).extend({

});
this.out = new PassThrough();
this.process.stdout.pipe(this.out, {
end: false
});
this.process.on('close', function(code, signal) {
if (code !== null && code !== 0) {
_this.emit('error', new Error("exited with code " + code));
}
if (signal !== null) {
_this.emit('error', new Error("killed by signal " + signal));
}
return _this.out.end();
});
}
Process.prototype.pipe = function(dest, options) {
return this.process.stdout.pipe(dest, options);
return this.out.pipe(dest, options);
};
Process.prototype._pipeline = function() {
return [this.process.stdin, this.process.stdout, this.process.stderr, this.out];
};
Process.prototype._extra_report_string = function() {

@@ -35,0 +53,0 @@ return ("stdin:" + this.process.stdin._writableState.length) + (" pid:" + this.process.pid) + (" stdout:" + this.process.stdout._readableState.length);

9

lib-js/transforms/queue.js

@@ -41,9 +41,10 @@ // Generated by CoffeeScript 1.6.3

return _this.options.fn(payload, function(err, out) {
if (err) {
if (_this._err == null) {
_this._err = err;
}
}
if (_this._err) {
return setImmediate(cb);
}
if (err) {
_this.end();
return setImmediate(cb, _this._err = err);
}
if (out !== void 0) {

@@ -50,0 +51,0 @@ _this.push(out);

{
"name": "understream",
"version": "0.10.10",
"version": "0.10.11",
"description": "stream helpers",

@@ -32,3 +32,6 @@ "engines": {

"JSONStream": "~0.7.1"
},
"publishConfig": {
"registry": "https://registry.npmjs.org"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet