0.2.0 • Published 9 years ago
prom-spawn v0.2.0
Alternative solutions
- https://github.com/bitsofinfo/stateful-process-command-proxy
- https://gist.github.com/millermedeiros/4724047
Examples
// basic usage
var p = require('prom-spawn');
// note that p() returns a function that returns a promise
p('rm', '-rf', 'tmpfolder')().then(function() {
console.log('Success!');
});
// chaining commands
var p = require('prom-spawn');
p('createdb', 'mydb', '-T', 'template_db')()
.then(p('psql', 'mydb', '-c', 'DELETE FROM mytable WHERE 1=1'))
.then(('sed','-i','s/good/such wow/g','doge.txt'));