spawn-please
Promisified child_process.spawn. *Supports stdin* *Rejects on stderr*
Last updated 3 years ago by raine .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ npm install spawn-please 
SYNC missed versions from official npm registry.

spawn-please

npm version

Easy and small child_process.spawn.

  • Promise-based
  • Cross-platform
  • Pass stdin as an argument
  • Rejects on stderr by default, even if exit code is 0

Install

$ npm install --save spawn-please

Usage

(
  command: string,
  args?: string[],
  options?: Options,
  spawnOptions?: any,
): Promise<{
  stdout: string
  stderr: string
}>
import spawn from 'spawn-please'

const { stdout, stderr } = await spawn('printf', ['please?'])

assert.equal(stdout, 'please?')
assert.equal(stderr, '')

Options

  • rejectOnError: boolean - Throws an error if stderr is non-empty. Default: true.
  • stdin: string - Send stdin to the spawned child process.
  • stdout: (data: string) => void - Stream stdout by chunk.
  • stderr: (data: string) => void - Stream stderr by chunk.

License

ISC © Raine Revere

Current Tags

  • 4.0.0                                ...           latest (3 months ago)

11 Versions

  • 4.0.0                                ...           3 months ago
  • 3.0.0                                ...           3 years ago
  • 2.0.2                                ...           3 years ago
  • 2.0.1                                ...           4 years ago
  • 2.0.0                                ...           4 years ago
  • 1.0.0                                ...           6 years ago
  • 0.4.1                                ...           6 years ago
  • 0.4.0                                ...           6 years ago
  • 0.3.0                                ...           9 years ago
  • 0.2.0                                ...           10 years ago
  • 0.1.0                                ...           11 years ago
Maintainers (1)
Downloads
Total 37
Today 1
This Week 1
This Month 18
Last Day 0
Last Week 1
Last Month 13
Dependencies (1)
Dev Dependencies (18)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE