0.2.3 • Published 10 years ago
auto-yield v0.2.3
auto-yield
Automatically add yield to generator calls.
Installation
$ npm install auto-yieldUsage
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