New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

regenerator

Package Overview
Dependencies
Maintainers
1
Versions
149
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

regenerator

Source transformer enabling ECMAScript 6 generator functions (yield) in JavaScript-of-today (ES5)

  • 0.1.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
21K
decreased by-73.34%
Maintainers
1
Weekly downloads
 
Created
Source

regenerator

This package implements a fully-functional source transformation that takes the proposed syntax for generators/yield from future versions of JS (ECMAScript6 or ES6, experimentally implemented in Node.js v0.11) 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 regenerator

From GitHub:

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

Usage

You have several options for using this module.

Simplest usage:

path/to/node_modules/regenerator/bin/regenerate es6.js > es5.js

Programmatic usage:

var es5Source = require("regenerator")(es6Source);

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?

Fork the repository, create some failing tests cases, and send me pull requests. If you're feeling brave, you are more than welcome to dive into the transformer code and fix the bug(s) yourself.

Keywords

FAQs

Package last updated on 11 Oct 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc