0.3.0 • Published 8 years ago

pull-spawn-process v0.3.0

Weekly downloads
15
License
-
Repository
github
Last release
8 years ago

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)