regenerator

Created October 22, 2013Updated October 14218 Forks2102 Stars813 Commits51 Open IssuesWeb · Framework

Regenerator is a source transformer enabling ECMAScript 6 generator functions (yield) in JavaScript-of-today (ES5).

The generator syntax provides a much cleaner alternative to using callbacks when writing asynchronous server-side code.

However, if you choose to use generator functions in Node.js, you end up with a bunch of code that can't be executed client-side: native support for generators is only so exciting because it enables you to write really clean, powerful, unportable code.

We developed a tool called regenerator to replace generator functions with efficient JavaScript-of-today (ECMAScript 5 or ES5 for short) that behaves the same way.

Regenerator relies heavily on the Esprima JavaScript parser and two libraries that we maintain for manipulating abstract syntax trees, ast-types and recast. It is similar in spirit to Google's Traceur Compiler, which supports generators and many other ES6 features through source transformation, but we would argue it compares favorably to Traceur in several ways.

Created October 22, 2013Updated October 14218 Forks2102 Stars813 Commits51 Open IssuesWeb · Framework

Keep Updated

Stay up-to-date via RSS with the latest open source project releases from Facebook, news from our Engineering teams, and upcoming events.

Subscribe
Facebook © 2017