Transform async/generator functions with regenerator
$ npm install babel-plugin-transform-regenerator
.babelrc
// without options
{
"plugins": ["transform-regenerator"]
}
// with options
{
"plugins": [
["transform-regenerator", {
asyncGenerators: false, // true by default
generators: false, // true by default
async: false // true by default
}]
]
}
$ babel --plugins transform-regenerator script.js
require("babel-core").transform("code", {
plugins: ["transform-regenerator"]
});