Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
command_runner
Advanced tools
Node.js module for running system commands and returning a Promise.
command_runner simply adds some Promise wrappers around the standard Node.js .exec() and .spawn() functions in the child_process module. The API is basically unchanged, but there are some changes in the implementation:
Example:
var CR = require('command_runner');
CR.exec('ls -al').then(function (res) {
console.log('exitCode: %i', res.exitCode); // 0
console.log('exitSignal: %s', res.exitSignal); // null
console.log('stdout: %s', res.stdout); // dir listing ....
console.log('stderr: %s', res.stderr); // empty string
console.log('errorMessage: %s', res.errorMessage); // undefined
});
command_runner.exec() always sets the exitCode and exitSignal, even if there is no error (to 0 and null, respectively), where the native Node.js child_process.exec() does not set them unless there is an error.
Example: Running the same command above, in a different way. The important distinction is that a shell is not invoked with spawn().
var CR = require('command_runner');
CR.spawn('ls', ['a', 'l']).then(function (res) {
console.log('exitCode: %i', res.exitCode); // 0
console.log('exitSignal: %s', res.exitSignal); // null
console.log('stdout: %s', res.stdout); // dir listing ....
console.log('stderr: %s', res.stderr); // empty string
console.log('errorMessage: %s', res.errorMessage); // undefined
});
Unlike the native Node.js child_process.spawn(), command_runner.spawn() buffers stdout and stderr streams, and then resolves the promise with the results after the 'close' event is fired from the child process.
Copyright: (c) 2015 by Kris Walker kris@kixx.name (http://www.kixx.name/)
Unless otherwise indicated, all source code is licensed under the MIT license. See MIT-LICENSE for details.
FAQs
Run system commands and return a Promise.
The npm package command_runner receives a total of 8 weekly downloads. As such, command_runner popularity was classified as not popular.
We found that command_runner demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.