@chmontgomery/exec-promise

1.1.0 • Public • Published

exec-promise NPM version Build Status

Executes a command line string using child_process.exec under the covers, wrapped in a bluebird promise for convenience.

Install

$ npm install --save exec-promise

Usage

var execPromise = require('exec-promise');

execPromise('ls -l')
  .then(function(stdout, stderr) { // can inspect output if desired
    console.log('done!');
  })
  .catch(function(err) {
    throw err;
  });
  
/*
total 16
-rw-r--r--  1 montgomeryc  staff  162 Apr 24 14:40 index.js
drwxr-xr-x  3 montgomeryc  staff  102 Apr 24 14:40 node_modules
-rw-r--r--  1 montgomeryc  staff  271 Apr 24 14:40 package.json
done!
 */

API

execPromise(cmd[,options])

cmd

Required
Type: string

Command line to execute

options

Type: object
Default: null

The node.js child_process.exec options object

License

MIT © Chris Montgomery

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.0
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.1.0
    1
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i @chmontgomery/exec-promise

Weekly Downloads

1

Version

1.1.0

License

MIT

Last publish

Collaborators

  • chmontgomery