pull-spawn-process

0.3.0 • Public • Published

pull-spawn-process

Use pull-streams with child_process.spawn stdio

A convenient wrapper around child_process.spawn for use with pull-stream

var cat = spawn('cat', ['somefile.txt'])
 
// Read the process's stdout
pull(cat, drain(console.log))
 
// Write process stdin
pull(values(['foo', 'bar']), cat)

Returns a duplex stream with an additional error prop to handle proc.stderr. The other child_process methods are available too.

Install

npm install --save pull-spawn-process
 
# with yarn 
yarn add pull-spawn-process

Usage

spawn(command, args?, options?)

The signature is the same as child_process.spawn, except returns a duplex pull-stream.

var cat = spawn('cat')
var echo = spawn('echo', ['foo', 'bar'])
var eslint = spawn('eslint', files, { stdio: 'inherit' })

The rest of the ChildProcess methods are exposed on the object


Maintained by Jamen Marz (See on Twitter and GitHub for questions & updates)

Dependents (1)

Package Sidebar

Install

npm i pull-spawn-process

Weekly Downloads

1

Version

0.3.0

License

none

Last publish

Collaborators

  • jamen