1.0.1 • Published 6 years ago
spawnback v1.0.1
spawnback
Simplified process spawning with buffered output in a callback.
Support this project by donating on Gratipay.
Installation
npm install spawnbackUsage
var spawn = require( "spawnback" );
spawn( "git", [ "status" ], function( error, stdout ) {
console.log( stdout );
});API
spawnback follows the same API as node's built-in child_process.spawn(), but accepts a callback as the final parameter. The callback receives three paramaters: an error object, stdout as a string, and stderr as a string.
spawnback( command, args, options, callback )
commandString: The command to run.argsArray: List of string arguments.optionsObject: See the node API docs for full details on which options are supported.callbackfunction( error, stdout, stderr ): A callback to invoke when the child process has ended and all stdio streams have terminated.- return:
ChildProcessinstance.
License
Copyright 2014 Scott González. Released under the terms of the MIT license.
Support this project by donating on Gratipay.