Socket
Socket
Sign inDemoInstall

@babel/plugin-transform-async-generator-functions

Package Overview
Dependencies
58
Maintainers
4
Versions
23
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @babel/plugin-transform-async-generator-functions

Turn async generator functions into ES2015 generators


Version published
Weekly downloads
15M
decreased by-0.83%
Maintainers
4
Install size
4.47 MB
Created
Weekly downloads
 

Package description

What is @babel/plugin-transform-async-generator-functions?

The @babel/plugin-transform-async-generator-functions package is a Babel plugin that transforms async generator functions and for-await loops to ES2015/ES6-compatible code. This allows developers to use async generator functions in environments that do not support them natively.

What are @babel/plugin-transform-async-generator-functions's main functionalities?

Transformation of async generator functions

This feature allows developers to write async generator functions, which are then transformed into code that can be executed in environments that do not support async generators natively.

async function* asyncGenerator() {
  var i = 0;
  while (i < 3) {
    yield i++;
  }
}

Transformation of for-await loops

This feature enables the use of for-await loops to iterate over async iterable objects, which is transformed into a series of promise resolutions compatible with older JavaScript engines.

async function iterateAsyncGenerator() {
  for await (const num of asyncGenerator()) {
    console.log(num);
  }
}

Other packages similar to @babel/plugin-transform-async-generator-functions

Changelog

Source

v7.24.3 (2024-03-20)

:bug: Bug Fix
  • babel-helper-module-imports
    • #16370 fix: do not inject the same imported identifier multiple times (@ota-meshi)

Readme

Source

@babel/plugin-transform-async-generator-functions

Turn async generator functions into ES2015 generators

See our website @babel/plugin-transform-async-generator-functions for more information.

Install

Using npm:

npm install --save-dev @babel/plugin-transform-async-generator-functions

or using yarn:

yarn add @babel/plugin-transform-async-generator-functions --dev

Keywords

FAQs

Last updated on 20 Mar 2024

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc