regenerator
Source transformer enabling ECMAScript 6 generator functions (yield) in JavaScript-of-today (ES5)
Last updated 13 days ago by benjamn .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm 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.5                                ...           latest (13 days ago)
  • 0.14.3                                ...           next (5 months ago)

142 Versions

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

Copyright 2014 - 2017 © taobao.org |