Skip to content

aobo-y/co-vorpal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

co-vorpal

co-vorpal is vorpal wrapper that enable using generator as command

Installation

$ npm install co-vorpal

Usage

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

About

Enable writing vorpal app with generator

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published