A fluent interface for launching child processes in Node
npm install spawner#Spawner
A fluent and friendly wrapper for Node's Child Process spawning stuff.
To install
npm install spawner
In your javascript file.
var spawner = require('spawner');
spawner()
.withArguments(['-a', 'hello'])
Set the arguments to be passed to the executable
spawner()
.withArguments( args )
.inWorkingDirectory('/path/to/wd')
Defines the working directory for the process to be spawned in.
spawner()
.onStdout( callback )
callback gets a stream from the process stdout. By default it is logged to the console.
spawner()
.onStderr( callback )
callback gets a stream from the process stderr. By default it is logged to the console.
spawner()
.withArguments( args )
.inWorkingDirectory( folder )
.spawn( 'node' , function(err){
// err = process exit code.
})
MIT