child-command
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

child-command

CircleCI NPM Downloads node License MIT

Executes a shell command with a Promise API

Highlights

  • Returns Promise

  • Written in Typescript

Usage

 
const childCommand = require('child-command');
 
childCommand('node -v')
.then((result) => {
  console.log(result.stdout); // v10.16.0
});
 
 
childCommand('exit 2')
.catch((error) => {
  console.log(error.code); // 2
});
 
 
childCommand('>&2 echo "error"')
.then((result) => {
  console.log(result.stderr); // error
})
 

License

MIT © Nivrith Mandayam Gomatam

Package Sidebar

Install

npm i child-command

Weekly Downloads

24

Version

1.0.3

License

MIT

Unpacked Size

167 kB

Total Files

9

Last publish

Collaborators

  • nivrith