Node.js Shell
A simple command runner for Node.js with promise support.
Installation
$ npm install @eddieajau/shell
Example
var Shell = require('@eddieajau/shell');
// Optionally set a logger.
Shell.setLogger(console.log);
// Execute the shell command.
Shell.exec('ls', [], { cwd: __dirname })
.then(function (result) {
console.log('The command returned %d', result.code);
console.log('STDOUT:', result.stdout.join('\n'));
console.log('STDERR:', result.stderr.join('\n'));
})
.catch(function (err) {
console.error('The child process emitted an error.', err);
});
Code quality and tests
$ npm run lint
$ npm run test
License
MIT