alert / js / node_modules / regenerator-transform /
@Réz István Réz István authored on 18 Nov 2021
..
lib first commit 3 years ago
src first commit 3 years ago
LICENSE first commit 3 years ago
README.md first commit 3 years ago
package.json first commit 3 years ago
README.md

regenerator-transform

Transform async/generator functions with regenerator

Installation

$ npm install regenerator-transform

Usage

Via .babelrc (Recommended)

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