co-exec
Version:
exec() wrapper for 'co'
31 lines (19 loc) • 505 B
Markdown
Node core `exec()` wrapped to return a thunk for [co](https://github.com/visionmedia/co).
```
$ npm install co-exec
```
Do some stuff with git:
```js
var co = require('co');
var exec = require('co-exec');
co(function *(){
var commit = yield exec('git rev-parse HEAD');
var commits = yield exec('git rev-list master | wc -l');
console.log('the latest commit is %s, with a total of %s', commit.slice(0, 5), commits.trim());
});
```
MIT