spawn-please

WebJar for spawn-please

License

License

ISC
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

spawn-please
Last Version

Last Version

0.3.0
Release Date

Release Date

Type

Type

jar
Description

Description

spawn-please
WebJar for spawn-please
Project URL

Project URL

https://www.webjars.org
Source Code Management

Source Code Management

https://github.com/raineorshine/spawn-please

Download spawn-please

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/spawn-please/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>spawn-please</artifactId>
    <version>0.3.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/spawn-please/
implementation 'org.webjars.npm:spawn-please:0.3.0'
// https://jarcasting.com/artifacts/org.webjars.npm/spawn-please/
implementation ("org.webjars.npm:spawn-please:0.3.0")
'org.webjars.npm:spawn-please:jar:0.3.0'
<dependency org="org.webjars.npm" name="spawn-please" rev="0.3.0">
  <artifact name="spawn-please" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='spawn-please', version='0.3.0')
)
libraryDependencies += "org.webjars.npm" % "spawn-please" % "0.3.0"
[org.webjars.npm/spawn-please "0.3.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

spawn-please

npm version

Promisified child_process.spawn. *Supports stdin* *Rejects on stderr*

Install

$ npm install --save spawn-please

Usage

await spawn(command, [arguments], [stdin], [options])

options are passed directly to child_process.spawn.

const spawn = require('spawn-please')

const output = await spawn('printf', ['please?'])
assert.equal(output, 'please?')

How is this different than other child_process libraries?

  • Allows you to pass a string to stdin:
const output = await spawn('cat', [], 'test')
assert.equal(output, 'test')
  • Rejects on any stderr:
try {
  spawn('some-command-with-stderr')
}
catch (stderr) {
  // do something with stderr
}

Using your own Promise library

spawn-please uses the global Promise object by default. You may use your own Promise library by overriding the Promise property:

const spawn = require('spawn-please')
spawn.Promise = require('bluebird')

License

ISC © Raine Revere

Versions

Version
0.3.0