babel-plugin-transform-regenerator
Source transformer enabling ECMAScript 6 generator functions (yield) in JavaScript-of-today (ES5)
Last updated 9 years ago by sebmck .
BSD · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install babel-plugin-transform-regenerator 
SYNC missed versions from official npm registry.

babel-plugin-transform-regenerator

Transform async/generator functions with regenerator

Example

In

function* a() {
  yield 1;
}

Out

var _marked = [a].map(regeneratorRuntime.mark);

function a() {
  return regeneratorRuntime.wrap(function a$(_context) {
    while (1) {
      switch (_context.prev = _context.next) {
        case 0:
          _context.next = 2;
          return 1;

        case 2:
        case "end":
          return _context.stop();
      }
    }
  }, _marked[0], this);
}

Installation

npm install --save-dev babel-plugin-transform-regenerator

Usage

Via .babelrc (Recommended)

Without options:

{
  "plugins": ["transform-regenerator"]
}

With options:

name default value
asyncGenerators true
generators true
async true
{
  "plugins": [
    ["transform-regenerator", {
      "asyncGenerators": false,
      "generators": false,
      "async": false
    }]
  ]
}

Via CLI

babel --plugins transform-regenerator script.js

Via Node API

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

Current Tags

  • 6.26.0                                ...           latest (7 years ago)
  • 7.0.0-beta.3                                ...           next (7 years ago)

53 Versions

  • 7.0.0-beta.3                                ...           7 years ago
  • 7.0.0-beta.2                                ...           7 years ago
  • 7.0.0-beta.1                                ...           7 years ago
  • 7.0.0-beta.0                                ...           7 years ago
  • 7.0.0-alpha.20                                ...           7 years ago
  • 6.26.0                                ...           7 years ago
  • 7.0.0-alpha.19                                ...           7 years ago
  • 7.0.0-alpha.18                                ...           7 years ago
  • 7.0.0-alpha.17                                ...           7 years ago
  • 7.0.0-alpha.16                                ...           7 years ago
  • 7.0.0-alpha.15                                ...           7 years ago
  • 7.0.0-alpha.14                                ...           7 years ago
  • 7.0.0-alpha.12                                ...           8 years ago
  • 7.0.0-alpha.11                                ...           8 years ago
  • 7.0.0-alpha.10                                ...           8 years ago
  • 7.0.0-alpha.9                                ...           8 years ago
  • 7.0.0-alpha.8                                ...           8 years ago
  • 6.24.1                                ...           8 years ago
  • 7.0.0-alpha.7                                ...           8 years ago
  • 7.0.0-alpha.3                                ...           8 years ago
  • 7.0.0-alpha.1                                ...           8 years ago
  • 6.22.0                                ...           8 years ago
  • 6.21.0                                ...           8 years ago
  • 6.20.0                                ...           8 years ago
  • 6.16.1                                ...           8 years ago
  • 6.16.0 [deprecated]           ...           8 years ago
  • 6.14.0                                ...           8 years ago
  • 6.11.4                                ...           8 years ago
  • 6.9.0                                ...           9 years ago
  • 6.8.0                                ...           9 years ago
  • 6.6.5                                ...           9 years ago
  • 6.6.0                                ...           9 years ago
  • 6.5.2                                ...           9 years ago
  • 6.5.0-1                                ...           9 years ago
  • 6.5.0                                ...           9 years ago
  • 6.4.4                                ...           9 years ago
  • 6.4.3                                ...           9 years ago
  • 6.3.26                                ...           9 years ago
  • 6.3.18                                ...           9 years ago
  • 6.3.13                                ...           9 years ago
  • 6.3.2                                ...           9 years ago
  • 6.2.4                                ...           9 years ago
  • 6.2.0                                ...           9 years ago
  • 6.1.18                                ...           9 years ago
  • 6.1.17                                ...           9 years ago
  • 6.1.4                                ...           9 years ago
  • 6.0.18                                ...           9 years ago
  • 6.0.17                                ...           9 years ago
  • 6.0.14                                ...           9 years ago
  • 6.0.12                                ...           9 years ago
  • 6.0.10                                ...           9 years ago
  • 6.0.8                                ...           9 years ago
  • 6.0.2                                ...           9 years ago
Downloads
Today 0
This Week 0
This Month 15
Last Day 0
Last Week 15
Last Month 0
Dev Dependencies (3)

Copyright 2013 - present © cnpmjs.org | Home |