0.1.0 • Published 2 years ago
childprocess-spawn-detached v0.1.0
childprocess-spawn-detached
A slightly more concise API for child_process.spawn().
API
This module exports one function:
spawn(prog, args)
Basically the same interface as child_process.spawn(), except:
- When
progis false-y, do nothing and just returnfalse.- This is meant to save you an if statement and repetition of the
config lookup code when your program's config has an optional
setting for a notification command.
Example:
spawn(process.env.coolserver_notify_listening);
- This is meant to save you an if statement and repetition of the
config lookup code when your program's config has an optional
setting for a notification command.
Example:
opt.detachedistrueby default.- When
opt.detached, a missing or false-yopt.stdiomeans'ignore'. - When
argsis false-y,opt.shelldefaults totrue.
Known issues
- Needs more/better tests and docs.
License
ISC