Registry / devops / rollup-plugin-async

rollup-plugin-async

JSON →
library1.2.0jsnpmunverified

Rollup plugin that transforms async/await functions into generator functions during bundling using async-to-gen. Current stable version 1.2.0, last released circa 2017. Low release cadence. Differentiator: enables async/await in environments without native support by converting to generators at build time. Alternative to Babel's async-to-generator transform with tighter Rollup integration. Depends on async-to-gen (v1.2.0+). No longer actively maintained; users should consider @rollup/plugin-babel with @babel/plugin-transform-async-to-generator.

npm install rollup-plugin-async
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-ASYN
R
rollup-plugin-async
devopsjavascriptv1.2.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import async from 'rollup-plugin-async'
const async = require('rollup-plugin-async')
CommonJS with require works but the package does not have typed exports. Default export is a factory function.
default
const async = require('rollup-plugin-async')
CommonJS require is supported. For ESM use import.
async
import async from 'rollup-plugin-async'
import { async } from 'rollup-plugin-async'
The package exports a single default function. Named import will not work.

Shows how to use rollup-plugin-async in a Rollup config to transform async functions in input.js.

import { rollup } from 'rollup'; import async from 'rollup-plugin-async'; rollup({ input: 'input.js', plugins: [async()] }).then(bundle => bundle.write({ file: 'output.js', format: 'iife' }));
Debug
Known issues
deprecatedPackage is no longer actively maintained. Use @rollup/plugin-babel with @babel/plugin-transform-async-to-generator instead.
fix
Replace with @rollup/plugin-babel configuration.
affects: >=1.0.0
gotchaAsync-to-gen may not support all modern async/await syntax variants (e.g., top-level await, for-await-of).
fix
Test with your specific async patterns. Consider migrating to Babel if issues arise.
affects: >=1.0.0
breakingVersion 1.2.0 updated async-to-gen to 1.2.0 with proper for-await-of loop support. Older versions may fail on for-await-of.
fix
Upgrade to version 1.2.0 or later.
affects: <1.2.0
Errors
Common errors & fixes
Cannot find module 'rollup-plugin-async'
Package not installed or not in node_modules.
fix
Run `npm install rollup-plugin-async --save-dev`.
TypeError: async is not a function
Importing the default export incorrectly as a named import or calling require without parentheses.
fix
Use `const async = require('rollup-plugin-async');` then call `async()`.
Error: Cannot find module 'async-to-gen'
Missing dependency async-to-gen (should be installed automatically but may not be in some setups).
fix
Run `npm install async-to-gen` or check your package-lock.
Upgrade
Version history
1.2.0latest on npm
Audit
Dependencies
async-to-genrequiredcore transformation engine for converting async functions to generator functions
Agent activity
8 hits · last 30 days
node
6
Resources
rollup-plugin-async — npm install rollup-plugin-async · libregistry