Skip to content

Latest commit

 

History

History
62 lines (40 loc) · 1.42 KB

readme.md

File metadata and controls

62 lines (40 loc) · 1.42 KB

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 @chmontgomery/exec-promise

Usage

var execPromise = require('@chmontgomery/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