shell-task
Proof-of-concept then-able shell commands in node. (Although it looks like a promise, it is NOT)
Install
$ npm install shell-task
Usage
var Task = require('shell-task')
new Task('git init')
.then('sleep 1000')
.then('git add .')
.then(doSomething)
.then('git commit -m "testing this cool stuff"')
.then('git remote add ...')
.then('git push -u origin master')
.run(onSuccess, onError)
function doSomething (next) {
console.log('doing something...')
setTimeout(next, 1000)
}
function onSuccess () {
console.log('done!')
}
function onError (e) {
throw e
}