Notoriously Psychedelic Modules

npm

npm’s 2019 JavaScript ecosystem survey analysis is now available!Get your copy here »

promise-child

1.0.1 • Public • Published

Build Status npm version

promise-child

Create a promise from a ChildProcess.

Install

npm install promise-child --save

Use

var promisify = require("promise-child");
var spawn = require("child_process").spawn;
 
var child = spawn("echo", ["hello"]);
 
promisify(child).then(function(code){
 // code === 0
});
 
promisify(child, {
  stdout: true
}).then(function(result){
  // result.code === 0
  // result.stdout -> Whatever stdout spit out.
});

License

BSD 2 Clause

install

npm i promise-child

Downloadsweekly downloads

38

version

1.0.1

license

BSD-2-Clause

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability