Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

regenerator-transform

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

regenerator-transform

Explode async and generator functions into a state machine.

  • 0.14.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
23M
decreased by-6.64%
Maintainers
1
Weekly downloads
 
Created

What is regenerator-transform?

The regenerator-transform package is a plugin for Babel that allows you to transform ES2015+ generator functions into ES5 code. It is part of the Regenerator project, which aims to enable the use of generators and async functions in environments that do not natively support them. This package is typically used in the build process of JavaScript applications to ensure compatibility with older browsers or JavaScript engines.

What are regenerator-transform's main functionalities?

Generator Function Transformation

Transforms generator functions into ES5 code using the Babel plugin system. This allows developers to write modern JavaScript with generator functions and yield syntax, and then compile it down to code that can run in older JavaScript environments.

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

Async/Await Transformation

Enables the use of async/await syntax in JavaScript code by transforming it into generator functions and then into ES5 code. This is useful for writing asynchronous code in a more synchronous style, which can be easier to read and maintain.

require('babel-core').transform('async function foo() { await bar(); }', {
  plugins: ['regenerator-transform']
});

Other packages similar to regenerator-transform

Keywords

FAQs

Package last updated on 19 Jul 2019

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