Executes a command line string using child_process.exec under the covers, wrapped in a bluebird promise for convenience.
$ npm install --save @chmontgomery/exec-promise
var execPromise = require('@chmontgomery/exec-promise');
execPromise('ls -l')
.then(function(stdout, stderr) { // can inspect output if desired
console.log('done!');
})
.catch(function(err) {
throw err;
});
/*
total 16
-rw-r--r-- 1 montgomeryc staff 162 Apr 24 14:40 index.js
drwxr-xr-x 3 montgomeryc staff 102 Apr 24 14:40 node_modules
-rw-r--r-- 1 montgomeryc staff 271 Apr 24 14:40 package.json
done!
*/
Required
Type: string
Command line to execute
Type: object
Default: null
The node.js child_process.exec options object
MIT © Chris Montgomery