Hatchling
Buffered spawn for node.
Example
var spawn = timeout; var child = ; timeout = ; // kill it after a second if we dont hear back // Example with invalid command options;
Reasoning
Spawn is awesome but sometimes you need a quick way to just get the output and go. Hatcling lets you pass in as many or as few arguments as you want. The structure is:
spawn(cmd, [args], [options], [cb])
cmd
is a string of the command to executeargs
is an array of arguments passedopts
is an option which is standardprocess.spawn
optionscb
is a function that takesfn(err, stderr/stdout)
. Iferr
is not null,stderr
will be given. Otherwise it isstdout
. If a process exits with a non-zero status code, an error will be thrown.