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

regenerator Build Status

This package implements a fully-functional source transformation that takes the syntax for generators/yield from ECMAScript 2015 or ES2015 and Asynchronous Iteration proposal and spits out efficient JS-of-today (ES5) that behaves the same way.

A small runtime library (less than 1KB compressed) is required to provide the wrapGenerator function. You can install it either as a CommonJS module or as a standalone .js file, whichever you prefer.

Installation

From npm:

npm install -g regenerator

From GitHub:

cd path/to/node_modules
git clone git://github.com/facebook/regenerator.git
cd regenerator
npm install .
npm test

Usage

You have several options for using this module.

Simplest usage:

regenerator es6.js > es5.js # Just the transform.
regenerator --include-runtime es6.js > es5.js # Add the runtime too.
regenerator src lib # Transform every .js file in src and output to lib.

Programmatic usage:

var es5Source = require("regenerator").compile(es6Source).code;
var es5SourceWithRuntime = require("regenerator").compile(es6Source, {
  includeRuntime: true
}).code;

AST transformation:

var recast = require("recast");
var ast = recast.parse(es6Source);
ast = require("regenerator").transform(ast);
var es5Source = recast.print(ast);

How can you get involved?

The easiest way to get involved is to look for buggy examples using the sandbox, and when you find something strange just click the "report a bug" link (the new issue form will be populated automatically with the problematic code).

Alternatively, you can fork the repository, create some failing tests cases in test/tests.es6.js, and send pull requests for me to fix.

If you're feeling especially brave, you are more than welcome to dive into the transformer code and fix the bug(s) yourself, but I must warn you that the code could really benefit from better implementation comments.

Current Tags

  • 0.14.7                                ...           latest (4 years ago)
  • 0.14.3                                ...           next (5 years ago)

144 Versions

  • 0.14.7                                ...           4 years ago
  • 0.14.6                                ...           4 years ago
  • 0.14.5                                ...           4 years ago
  • 0.14.4                                ...           5 years ago
  • 0.14.3                                ...           5 years ago
  • 0.14.2                                ...           5 years ago
  • 0.14.1                                ...           6 years ago
  • 0.14.0                                ...           6 years ago
  • 0.13.4                                ...           6 years ago
  • 0.13.3                                ...           6 years ago
  • 0.13.2                                ...           6 years ago
  • 0.13.1                                ...           6 years ago
  • 0.13.0                                ...           6 years ago
  • 0.12.4                                ...           7 years ago
  • 0.12.3                                ...           7 years ago
  • 0.12.2                                ...           7 years ago
  • 0.12.1                                ...           7 years ago
  • 0.12.0                                ...           7 years ago
  • 0.11.1                                ...           7 years ago
  • 0.11.0                                ...           7 years ago
  • 0.10.1                                ...           7 years ago
  • 0.10.0                                ...           7 years ago
  • 0.9.7                                ...           8 years ago
  • 0.9.6                                ...           8 years ago
  • 0.9.5                                ...           8 years ago
  • 0.9.4                                ...           8 years ago
  • 0.9.3                                ...           8 years ago
  • 0.9.2                                ...           8 years ago
  • 0.9.1                                ...           8 years ago
  • 0.9.0                                ...           8 years ago
  • 0.8.46                                ...           9 years ago
  • 0.8.45                                ...           9 years ago
  • 0.8.44                                ...           9 years ago
  • 0.8.43                                ...           9 years ago
  • 0.8.42                                ...           9 years ago
  • 0.8.41                                ...           9 years ago
  • 0.8.40                                ...           9 years ago
  • 0.8.39                                ...           9 years ago
  • 0.8.38                                ...           9 years ago
  • 0.8.37                                ...           9 years ago
  • 0.8.36                                ...           9 years ago
  • 0.8.35                                ...           9 years ago
  • 0.8.34                                ...           9 years ago
  • 0.8.33                                ...           9 years ago
  • 0.8.32                                ...           9 years ago
  • 0.8.31                                ...           9 years ago
  • 0.8.30                                ...           9 years ago
  • 0.8.29                                ...           9 years ago
  • 0.8.28                                ...           9 years ago
  • 0.8.27                                ...           10 years ago
  • 0.8.26                                ...           10 years ago
  • 0.8.25                                ...           10 years ago
  • 0.8.24                                ...           10 years ago
  • 0.8.23                                ...           10 years ago
  • 0.8.22                                ...           10 years ago
  • 0.8.21                                ...           10 years ago
  • 0.8.20                                ...           10 years ago
  • 0.8.19                                ...           10 years ago
  • 0.8.18                                ...           10 years ago
  • 0.8.17                                ...           10 years ago
  • 0.8.16                                ...           10 years ago
  • 0.8.15                                ...           10 years ago
  • 0.8.14                                ...           10 years ago
  • 0.8.13                                ...           10 years ago
  • 0.8.12                                ...           10 years ago
  • 0.8.11                                ...           10 years ago
  • 0.8.10                                ...           10 years ago
  • 0.8.9                                ...           10 years ago
  • 0.8.8                                ...           10 years ago
  • 0.8.7                                ...           10 years ago
  • 0.8.6                                ...           10 years ago
  • 0.8.5                                ...           10 years ago
  • 0.8.4                                ...           10 years ago
  • 0.8.3                                ...           10 years ago
  • 0.8.2                                ...           10 years ago
  • 0.8.1                                ...           10 years ago
  • 0.8.0                                ...           10 years ago
  • 0.7.8                                ...           10 years ago
  • 0.7.7                                ...           10 years ago
  • 0.7.6                                ...           10 years ago
  • 0.7.5                                ...           10 years ago
  • 0.7.4                                ...           10 years ago
  • 0.7.3                                ...           10 years ago
  • 0.7.2                                ...           10 years ago
  • 0.7.1                                ...           10 years ago
  • 0.7.0                                ...           10 years ago
  • 0.6.10                                ...           10 years ago
  • 0.6.9                                ...           10 years ago
  • 0.6.8                                ...           10 years ago
  • 0.6.7                                ...           10 years ago
  • 0.6.6                                ...           10 years ago
  • 0.6.5                                ...           10 years ago
  • 0.6.4                                ...           10 years ago
  • 0.6.3                                ...           10 years ago
  • 0.6.2                                ...           10 years ago
  • 0.6.1                                ...           10 years ago
  • 0.6.0                                ...           10 years ago
  • 0.5.1                                ...           10 years ago
  • 0.5.2                                ...           10 years ago
  • 0.5.3                                ...           10 years ago
  • 0.5.0                                ...           10 years ago
  • 0.4.12                                ...           10 years ago
  • 0.4.11                                ...           10 years ago
  • 0.4.10                                ...           10 years ago
  • 0.4.9                                ...           10 years ago
  • 0.4.8                                ...           11 years ago
  • 0.4.7                                ...           11 years ago
  • 0.4.6                                ...           11 years ago
  • 0.4.5                                ...           11 years ago
  • 0.4.4                                ...           11 years ago
  • 0.4.3                                ...           11 years ago
  • 0.4.2                                ...           11 years ago
  • 0.4.1                                ...           11 years ago
  • 0.4.0                                ...           11 years ago
  • 0.3.9                                ...           11 years ago
  • 0.3.8                                ...           11 years ago
  • 0.3.7                                ...           11 years ago
  • 0.3.6                                ...           11 years ago
  • 0.3.5                                ...           11 years ago
  • 0.3.4                                ...           11 years ago
  • 0.3.3                                ...           11 years ago
  • 0.3.2                                ...           11 years ago
  • 0.3.1                                ...           11 years ago
  • 0.3.0                                ...           11 years ago
  • 0.2.11                                ...           11 years ago
  • 0.2.10                                ...           11 years ago
  • 0.2.9                                ...           11 years ago
  • 0.2.8                                ...           11 years ago
  • 0.2.7                                ...           11 years ago
  • 0.2.6                                ...           11 years ago
  • 0.2.5                                ...           11 years ago
  • 0.2.4                                ...           11 years ago
  • 0.2.3                                ...           11 years ago
  • 0.2.2                                ...           11 years ago
  • 0.2.1                                ...           11 years ago
  • 0.2.0                                ...           11 years ago
  • 0.1.7                                ...           11 years ago
  • 0.1.6                                ...           11 years ago
  • 0.1.5                                ...           11 years ago
  • 0.1.4                                ...           11 years ago
  • 0.1.3                                ...           11 years ago
  • 0.1.2                                ...           11 years ago
  • 0.1.1                                ...           11 years ago
  • 0.1.0                                ...           11 years ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (10)

Copyright 2013 - present © cnpmjs.org | Home |