Package Exports
- co-vorpal
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (co-vorpal) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
co-vorpal
co-vorpal is vorpal wrapper that enable using generator as command
Installation
$ npm install co-vorpalUsage
Wrap the vorpal client
var vorpal = require('vorpal')()
var coVorpal = require('co-vorpal')
coVorpal(vorpal)Use co style generator as command action
vorpal
.command('foo <bar>')
.action(function* (args) {
var res = yield asyncApi(args.bar)
this.log(res)
})Still able to use normal function, won't affect existing code
vorpal
.command('foo <bar>')
.action(function (args, cb) {
asyncApi(args.bar, (err, res) => {
this.log(res)
cb()
})
})License
MIT