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

cross-spawn-promise

Package Overview
Dependencies
Maintainers
2
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cross-spawn-promise - npm Package Compare versions

Comparing version 0.8.0 to 0.9.0

49

lib/index.js

@@ -46,19 +46,32 @@ 'use strict';

var concatBuffer = function concatBuffer(buffer) {
if (buffer.length === 0) {
return null;
} else if (typeof buffer[0] === 'string') {
return buffer.join('');
} else if (Buffer.isBuffer(buffer[0])) {
return Buffer.concat(buffer);
} else {
throw new Error('Unexpected buffer type');
}
};
exports.default = function (cmd, args) {
var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2];
return new Promise(function (resolve, reject) {
var proc = (0, _crossSpawn2.default)(cmd, args, options);
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
var childProcess = void 0;
var promise = new Promise(function (resolve, reject) {
childProcess = (0, _crossSpawn2.default)(cmd, args, options);
var stdout = null;
var stderr = null;
var _parseStdioOption = parseStdioOption(options.stdio);
var _parseStdioOption = parseStdioOption(options.stdio),
_parseStdioOption2 = _slicedToArray(_parseStdioOption, 2),
ignoreStdout = _parseStdioOption2[0],
ignoreStderr = _parseStdioOption2[1];
var _parseStdioOption2 = _slicedToArray(_parseStdioOption, 2);
var ignoreStdout = _parseStdioOption2[0];
var ignoreStderr = _parseStdioOption2[1];
if (!ignoreStdout) {
stdout = [];
proc.stdout.on('data', function (data) {
childProcess.stdout.on('data', function (data) {
stdout.push(data);

@@ -69,23 +82,25 @@ });

stderr = [];
proc.stderr.on('data', function (data) {
childProcess.stderr.on('data', function (data) {
stderr.push(data);
});
}
proc.once('exit', function (code, signal) {
childProcess.once('exit', function (code, signal) {
var error = closeArgsToError(code, signal);
if (error !== null) {
if (!ignoreStdout) {
error.stdout = Buffer.concat(stdout);
error.stdout = concatBuffer(stdout);
}
if (!ignoreStderr) {
error.stderr = Buffer.concat(stderr);
error.stderr = concatBuffer(stderr);
}
reject(error);
} else {
resolve(ignoreStdout ? null : Buffer.concat(stdout));
resolve(ignoreStdout ? null : concatBuffer(stdout));
}
});
proc.once('error', reject);
childProcess.once('error', reject);
});
promise.childProcess = childProcess;
return promise;
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LmpzIl0sIm5hbWVzIjpbInNob3VsZElnbm9yZSIsInZhbHVlIiwicGFyc2VTdGRpb09wdGlvbiIsImlnbm9yZVN0ZG91dCIsImlnbm9yZVN0ZGVyciIsIkFycmF5IiwiaXNBcnJheSIsImNsb3NlQXJnc1RvRXJyb3IiLCJjb2RlIiwic2lnbmFsIiwiZXJyIiwiRXJyb3IiLCJleGl0U2lnbmFsIiwiZXhpdFN0YXR1cyIsImNtZCIsImFyZ3MiLCJvcHRpb25zIiwiUHJvbWlzZSIsInJlc29sdmUiLCJyZWplY3QiLCJwcm9jIiwic3Rkb3V0Iiwic3RkZXJyIiwic3RkaW8iLCJvbiIsImRhdGEiLCJwdXNoIiwib25jZSIsImVycm9yIiwiQnVmZmVyIiwiY29uY2F0Il0sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7Ozs7QUFFQTs7Ozs7O0FBRUEsSUFBTUEsZUFBZSxTQUFmQSxZQUFlLENBQUNDLEtBQUQ7QUFBQSxTQUFZQSxVQUFVLFFBQVYsSUFBc0JBLFVBQVUsU0FBNUM7QUFBQSxDQUFyQjs7QUFFQSxJQUFNQyxtQkFBbUIsU0FBbkJBLGdCQUFtQixDQUFDRCxLQUFELEVBQVc7QUFDbEMsTUFBSUUsZUFBZSxLQUFuQjtBQUNBLE1BQUlDLGVBQWUsS0FBbkI7QUFDQSxNQUFJSixhQUFhQyxLQUFiLENBQUosRUFBeUI7QUFDdkJFLG1CQUFlLElBQWY7QUFDQUMsbUJBQWUsSUFBZjtBQUNELEdBSEQsTUFHTyxJQUFJQyxNQUFNQyxPQUFOLENB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wgc2lnbmFsKVxuICAgICAgaWYgKGVycm9yICE9PSBudWxsKSB7XG4gICAgICAgIGlmICghaWdub3JlU3Rkb3V0KSB7XG4gICAgICAgICAgZXJyb3Iuc3Rkb3V0ID0gY29uY2F0QnVmZmVyKHN0ZG91dClcbiAgICAgICAgfVxuICAgICAgICBpZiAoIWlnbm9yZVN0ZGVycikge1xuICAgICAgICAgIGVycm9yLnN0ZGVyciA9IGNvbmNhdEJ1ZmZlcihzdGRlcnIpXG4gICAgICAgIH1cbiAgICAgICAgcmVqZWN0KGVycm9yKVxuICAgICAgfSBlbHNlIHtcbiAgICAgICAgcmVzb2x2ZShpZ25vcmVTdGRvdXQgPyBudWxsIDogY29uY2F0QnVmZmVyKHN0ZG91dCkpXG4gICAgICB9XG4gICAgfSlcbiAgICBjaGlsZFByb2Nlc3Mub25jZSgnZXJyb3InLCByZWplY3QpXG4gIH0pXG4gIHByb21pc2UuY2hpbGRQcm9jZXNzID0gY2hpbGRQcm9jZXNzXG4gIHJldHVybiBwcm9taXNlXG59XG4iXX0=
{
"name": "cross-spawn-promise",
"version": "0.8.0",
"version": "0.9.0",
"description": "Promisified cross-spawn.",

@@ -11,3 +11,3 @@ "main": "index.js",

"engines": {
"node": ">=0.12.0"
"node": ">=4"
},

@@ -28,10 +28,9 @@ "license": "MIT",

"dependencies": {
"cross-spawn": "^4.0.0"
"cross-spawn": "^5.0.1"
},
"devDependencies": {
"babel-eslint": "^6.1.2",
"babel-preset-es2015": "^6.14.0",
"babel-register": "^6.14.0",
"chai": "^3.5.0",
"chai-as-promised": "^5.3.0",
"chai-as-promised": "^6.0.0",
"del": "^2.2.2",

@@ -41,17 +40,14 @@ "gulp": "^3.9.1",

"gulp-coveralls": "^0.1.4",
"gulp-if": "^2.0.1",
"gulp-if": "^2.0.2",
"gulp-istanbul": "^1.1.1",
"gulp-load-plugins": "^1.2.4",
"gulp-load-plugins": "^1.4.0",
"gulp-mocha": "^3.0.1",
"gulp-notify": "^2.2.0",
"gulp-plumber": "^1.1.0",
"gulp-sourcemaps": "^1.6.0",
"gulp-standard": "^7.0.1",
"gulp-sourcemaps": "^1.9.1",
"gulp-standard": "^8.0.2",
"in-publish": "^2.0.0",
"isparta": "^4.0.0",
"run-sequence": "^1.2.2"
},
"standard": {
"parser": "babel-eslint"
"run-sequence": "^1.2.2",
"standard": "^8.5.0",
"yargs": "^6.4.0"
}
}
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