Skip to content

Latest commit

 

History

History
46 lines (35 loc) · 751 Bytes

File metadata and controls

46 lines (35 loc) · 751 Bytes

babel-plugin-transform-regenerator

Transform async/generator functions with regenerator

Installation

$ npm install babel-plugin-transform-regenerator

Usage

Via .babelrc (Recommended)

.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
    }]
  ]
}

Via CLI

$ babel --plugins transform-regenerator script.js

Via Node API

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