Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fabiandev/node-exec-promise

Execute commands from Node.js and get a Promise back.
https://github.com/fabiandev/node-exec-promise

exec javascript node promise

Last synced: 7 days ago
JSON representation

Execute commands from Node.js and get a Promise back.

Awesome Lists containing this project

README

        

# node-exec-promise

# Installation

```bash
npm install --save node-exec-promise
```

# Example Usage

```js
var exec = require('node-exec-promise').exec;

exec('ls -lah /tmp').then(function(out) {
console.log(out.stdout, out.stderr);
}, function(err) {
console.error(err);
});
```

# Example Gulp Usage

```js
var execFile = require('node-exec-promise').execFile;

gulp.task('example', function(done) {
execFile('ls', ['-lah', '/tmp']).then(function(out) {
done();
}, function(err) {
// handle error
});
});
```