Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
@babel/plugin-transform-async-generator-functions
Advanced tools
Turn async generator functions into ES2015 generators
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.
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);
}
}
The regenerator-runtime package provides a runtime for Regenerator-compiled generator and async functions. It is similar to @babel/plugin-transform-async-generator-functions in that it allows the use of async functions in older environments, but it is a runtime rather than a compile-time plugin.
This plugin transforms async functions to generator functions. While it does not directly transform async generator functions, it serves a similar purpose in allowing async functions to run in environments that do not support them natively.
Turn async generator functions into ES2015 generators
See our website @babel/plugin-transform-async-generator-functions for more information.
Using npm:
npm install --save-dev @babel/plugin-transform-async-generator-functions
or using yarn:
yarn add @babel/plugin-transform-async-generator-functions --dev
v7.25.0 (2024-07-26)
babel-helpers
, babel-plugin-proposal-explicit-resource-management
, babel-runtime-corejs3
babel-plugin-transform-typescript
babel-helper-create-class-features-plugin
, babel-helper-function-name
, babel-helper-plugin-utils
, babel-helper-wrap-function
, babel-plugin-bugfix-safari-class-field-initializer-scope
, babel-plugin-bugfix-safari-id-destructuring-collision-in-function-expression
, babel-plugin-transform-classes
, babel-plugin-transform-function-name
, babel-preset-env
, babel-traverse
, babel-types
ensureFunctionName
to NodePath.prototype
(@nicolo-ribaudo)babel-helper-hoist-variables
, babel-helper-plugin-utils
, babel-plugin-proposal-async-do-expressions
, babel-plugin-transform-modules-systemjs
, babel-traverse
hoistVariables
to Scope.prototype
(@nicolo-ribaudo)babel-helper-create-class-features-plugin
, babel-helper-module-transforms
, babel-helper-plugin-utils
, babel-helper-split-export-declaration
, babel-plugin-transform-classes
, babel-traverse
, babel-types
splitExportDeclaration
to NodePath.prototype
(@nicolo-ribaudo)babel-helper-create-class-features-plugin
, babel-helper-environment-visitor
, babel-helper-module-transforms
, babel-helper-plugin-utils
, babel-helper-remap-async-to-generator
, babel-helper-replace-supers
, babel-plugin-bugfix-firefox-class-in-computed-class-key
, babel-plugin-bugfix-v8-static-class-fields-redefine-readonly
, babel-plugin-transform-async-generator-functions
, babel-plugin-transform-classes
, babel-traverse
environment-visitor
helper into @babel/traverse
(@nicolo-ribaudo)babel-core
, babel-parser
.extra.async
(@nicolo-ribaudo)babel-compat-data
, babel-plugin-bugfix-safari-class-field-initializer-scope
, babel-preset-env
bugfix-safari-class-field-initializer-scope
(@davidtaylorhq)babel-plugin-transform-block-scoping
, babel-traverse
, babel-types
babel-helper-import-to-platform-api
, babel-plugin-proposal-json-modules
uncheckedRequire
option for JSON imports to CJS (@nicolo-ribaudo)babel-helper-transform-fixture-test-runner
, babel-node
babel-node --eval
(@slatereax)babel-compat-data
, babel-helper-create-regexp-features-plugin
, babel-plugin-proposal-duplicate-named-capturing-groups-regex
, babel-plugin-transform-duplicate-named-capturing-groups-regex
, babel-preset-env
, babel-standalone
babel-generator
babel-template
, babel-types
babel-generator
(
before ambiguous tokens (@nicolo-ribaudo)babel-helper-function-name
, babel-plugin-transform-arrow-functions
, babel-plugin-transform-function-name
, babel-preset-env
, babel-traverse
helper-function-name
logic (@nicolo-ribaudo)babel-parser
, babel-plugin-proposal-pipeline-operator
babel-plugin-transform-classes
assertThisInitialized
(@liuxingbaoyu)babel-helper-create-class-features-plugin
, babel-helper-replace-supers
, babel-helpers
, babel-plugin-proposal-decorators
, babel-plugin-transform-class-properties
, babel-plugin-transform-classes
, babel-plugin-transform-exponentiation-operator
, babel-plugin-transform-object-super
, babel-plugin-transform-private-methods
, babel-runtime-corejs2
, babel-runtime-corejs3
, babel-runtime
super.x
output (@liuxingbaoyu)babel-plugin-transform-class-properties
, babel-plugin-transform-classes
FAQs
Turn async generator functions into ES2015 generators
The npm package @babel/plugin-transform-async-generator-functions receives a total of 14,653,386 weekly downloads. As such, @babel/plugin-transform-async-generator-functions popularity was classified as popular.
We found that @babel/plugin-transform-async-generator-functions demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
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.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.