exec-then
v1.3.1
Published
Child process execute with promise, deferred
Downloads
1,060
Maintainers
Readme
Child process execute with promise, deferred
Install
$ npm install --save exec-then
Usage
var exec = require('exec-then');
exec('pwd').then(function(res) {
assert(res.stdout.indexOf(path.resolve(__dirname, '../')) !== -1);
}, function(err) {
console.log(err.toString());
assert(false);
});
exec(['ls', '-al'], function(std, deferred) {
if (std.stdout.indexOf('test') === -1) {
return deferred.reject();
}
return true;
}).then(function(res) {
if (res) {
console.log('You have test file');
}
}, function() {
console.log('Where am I?');
});
Options
exec-node
using same options to Child Process options except to options below.
verbose
: show stdio/stderr message while child process is running. if verbose set true?child_process.spawn
will be executed.
License
MIT © ragingwind