auto-yield
v0.2.3
Published
Automatically add yields and generators.
Downloads
1
Readme
auto-yield
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 transformglobalGens
- array of global names or object names that are generators or have generatorssecondOrderGens
- array of functions that return generators
Returns: transformed code
License
MIT