con-spawn
v0.1.0
Published
a conditional spawner that returns a promise
Downloads
9
Readme
Con Spawn
Conditionally spawn a process with a success and fail string to look for on stdout.
const conSpawn = require('con-spawn');
conSpawn('myAwesomeShellScript', [], 'it worked!', 'it failed')
.then((proc) => {
proc.kill('SIGTERM');
}, (err) => {
throw err;
});
conSpawn(command[,args][,success condition][,fail condition][,options])
- command the command to run
- args array of arguments to command
- success condition string that signifies success
- fail condition string that signifies failure
- options
- timeout time to wait for a failure or success