capture-spawn

Asynchronously capturing spawn output.
Install
npm i capture-spawn --save
Usage
For more use-cases see the tests
const captureSpawn =
captureSpawn
Capture output of asynchronous
spawn
.
Params
cp
{Stream}: Child process spawn stream.callback
{Function}: Gets error, result or result buffer -cb(err, res, buf)
.returns
{Stream}: Passedcp
stream.
Example
var captureSpawn = var spawn = var cp = var stream = console // => true
Error handling
Where
buffer
is thestderr
output andcode
can bestring
ornumber
.
var proc = // => SpawnError {// name: 'SpawnError',// message: '',// code: 1,// buffer: <Buffer 6d 6f 64 75 ...>// }
Related
- capture-stream: Capture stream output. | homepage
- cross-spawn: Cross platform child_process#spawn and child_process#spawnSync | homepage
- cross-spawn-async: Cross platform child_process#spawn | homepage
- function-arguments: Get arguments of a function, useful for and used in dependency injectors.… more | homepage
- gitclone-defaults: Powerful and flexible signature for
gitclone
- defaults, checks, validating, etc. | homepage - parse-git-config: Parse
.git/config
into a JavaScript object. sync or async. | homepage - parse-git-log: Parse default
git log
style to array of objects from git repository… more | homepage - run-commands: Cross-platform run series of commands or in parallel flow. Run commands in… more | homepage
- spawn-commands: Launches a new process with the given command, with command line arguments… more | homepage
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
But before doing anything, please read the CONTRIBUTING.md guidelines.