node-ejs-renderer/node_modules/regenerator-transform
2024-06-09 13:55:01 -04:00
..
lib Main initial commit 2024-06-09 13:55:01 -04:00
src Main initial commit 2024-06-09 13:55:01 -04:00
LICENSE Main initial commit 2024-06-09 13:55:01 -04:00
package.json Main initial commit 2024-06-09 13:55:01 -04:00
README.md Main initial commit 2024-06-09 13:55:01 -04:00

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