Regenerator transform

This plugin uses the regenerator module to transform async and generator functions.

Async functions

These are only usable if you enable their syntax plugin. See syntax-async-functions for information.

Installation

$ npm install babel-plugin-transform-regenerator

Usage

.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"]
});