spawnback

1.0.1 • Public • Published

spawnback

Simplified process spawning with buffered output in a callback.

Support this project by donating on Gratipay.

Installation

npm install spawnback

Usage

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 )

  • command String: The command to run.
  • args Array: List of string arguments.
  • options Object: See the node API docs for full details on which options are supported.
  • callback function( error, stdout, stderr ): A callback to invoke when the child process has ended and all stdio streams have terminated.
  • return: ChildProcess instance.

License

Copyright 2014 Scott González. Released under the terms of the MIT license.


Support this project by donating on Gratipay.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.18,707latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.18,707
1.0.07,988

Package Sidebar

Install

npm i spawnback

Weekly Downloads

16,695

Version

1.0.1

License

none

Unpacked Size

3.91 kB

Total Files

4

Last publish

Collaborators

  • scott.gonzalez