kid_process
Deal with child_process like you would a kid.
Highlights
- Forget about
disconnect
,error
,close
, andexit
. Listen forterminated
instead. error
events are ignored rather than exiting your parent process.- Same interface as spawn and fork. If your command ends in
.js
, then fork is used. - The kill method does nothing once an event from item 1 is emitted. This is a good idea because kill can kill another process with the same pid when called after a child_process has ended!
Example
var kid = ;kid;kid;
Idiosyncracies
- If the command ends in ".js", then fork is used instead of spawn. In
this case, the
message
event is listened for and emitted. Additionally,disconnect
andsend
are available as methods.