0.2.3 • Published 8 years ago

auto-yield v0.2.3

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

auto-yield

Build status Git tag NPM version Code style

Automatically add yield to generator calls.

Installation

$ npm install auto-yield

Usage

var autoYield = require('auto-yield')

var code = autoYield(`
function main () {
  move()
}

function * move () {
  yield 'moving'
}
`) =>

`function* main() {
yield move();
}

function* move() {
yield 'moving';
}`

API

autoYield(code, globalGens, secondOrderGens)

  • code - code to transform
  • globalGens - array of global names or object names that are generators or have generators
  • secondOrderGens - array of functions that return generators

Returns: transformed code

License

MIT

0.2.3

8 years ago

0.2.2

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.3

8 years ago