0.1.0 • Published 8 years ago

con-spawn v0.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

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,fail condition)

  • 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
0.1.0

8 years ago