promise-exec
A simple wrap for child_process.exec which returns promise
Installation
$ npm install promise-exec
API
exec
It's a promise version of child_process.exec
.
var exec = ; ;
exports.wrap
It's a sugar for subsequent thenable calls that makes code simpler and more elegant.
var exec = wrap; Promise ;
exports.execFile
Promise version of executing a shell script file, just like sh test.sh
.
test.sh:
touch index.txtecho "hello" > index.txt# comments will be ingored cat index.txt
index.js:
var fs = ;var path = ;var execFile = execFile;var file = path; ;