Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jamen/pull-spawn-process
Use pull-streams with child_process.spawn stdio
https://github.com/jamen/pull-spawn-process
Last synced: 17 days ago
JSON representation
Use pull-streams with child_process.spawn stdio
- Host: GitHub
- URL: https://github.com/jamen/pull-spawn-process
- Owner: jamen
- License: mit
- Created: 2017-05-08T12:23:26.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-05-08T12:33:21.000Z (over 7 years ago)
- Last Synced: 2024-10-25T19:35:56.587Z (19 days ago)
- Language: JavaScript
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# pull-spawn-process
> Use pull-streams with `child_process.spawn` stdio
A convenient wrapper around [`child_process.spawn`]() for use with [`pull-stream`](https://github.com/pull-stream/pull-stream)
```js
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
```sh
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`](https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options), except returns a duplex pull-stream.
```js
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](https://git.io/jamen) (See on [Twitter](https://twitter.com/jamenmarz) and [GitHub](https://github.com/jamen) for questions & updates)