setup-php/node_modules/regenerator-transform
2019-09-20 21:54:46 +05:30
..
lib Improve code quality and write tests 2019-09-20 21:54:46 +05:30
src Improve code quality and write tests 2019-09-20 21:54:46 +05:30
LICENSE Improve code quality and write tests 2019-09-20 21:54:46 +05:30
package.json Improve code quality and write tests 2019-09-20 21:54:46 +05:30
README.md Improve code quality and write tests 2019-09-20 21:54:46 +05:30

regenerator-transform

Transform async/generator functions with regenerator

Installation

$ npm install regenerator-transform

Usage

.babelrc

// without options
{
  "plugins": ["regenerator-transform"]
}
// with options
{
  "plugins": [
    ["regenerator-transform", {
      asyncGenerators: false, // true by default
      generators: false, // true by default
      async: false // true by default
    }]
  ]
}

Via CLI

$ babel --plugins regenerator-transform script.js

Via Node API

require("@babel/core").transformSync("code", {
  plugins: ["regenerator-transform"]
});