JSPM

co-vorpal

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q24494F
  • License MIT

Enable writing vorpal app with generator

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-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