{"id":21921,"library":"rollup-plugin-async","title":"rollup-plugin-async","description":"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.","status":"deprecated","version":"1.2.0","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/leebyron/rollup-plugin-async","tags":["javascript","rollup-plugin","async","await","async-to-gen"],"install":[{"cmd":"npm install rollup-plugin-async","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-async","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-async","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"core transformation engine for converting async functions to generator functions","package":"async-to-gen","optional":false}],"imports":[{"note":"CommonJS with require works but the package does not have typed exports. Default export is a factory function.","wrong":"const async = require('rollup-plugin-async')","symbol":"default","correct":"import async from 'rollup-plugin-async'"},{"note":"CommonJS require is supported. For ESM use import.","wrong":"","symbol":"default","correct":"const async = require('rollup-plugin-async')"},{"note":"The package exports a single default function. Named import will not work.","wrong":"import { async } from 'rollup-plugin-async'","symbol":"async","correct":"import async from 'rollup-plugin-async'"}],"quickstart":{"code":"import { rollup } from 'rollup';\nimport async from 'rollup-plugin-async';\n\nrollup({\n  input: 'input.js',\n  plugins: [async()]\n}).then(bundle => bundle.write({ file: 'output.js', format: 'iife' }));","lang":"javascript","description":"Shows how to use rollup-plugin-async in a Rollup config to transform async functions in input.js."},"warnings":[{"fix":"Replace with @rollup/plugin-babel configuration.","message":"Package is no longer actively maintained. Use @rollup/plugin-babel with @babel/plugin-transform-async-to-generator instead.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Test with your specific async patterns. Consider migrating to Babel if issues arise.","message":"Async-to-gen may not support all modern async/await syntax variants (e.g., top-level await, for-await-of).","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Upgrade to version 1.2.0 or later.","message":"Version 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.","severity":"breaking","affected_versions":"<1.2.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run `npm install rollup-plugin-async --save-dev`.","cause":"Package not installed or not in node_modules.","error":"Cannot find module 'rollup-plugin-async'"},{"fix":"Use `const async = require('rollup-plugin-async');` then call `async()`.","cause":"Importing the default export incorrectly as a named import or calling require without parentheses.","error":"TypeError: async is not a function"},{"fix":"Run `npm install async-to-gen` or check your package-lock.","cause":"Missing dependency async-to-gen (should be installed automatically but may not be in some setups).","error":"Error: Cannot find module 'async-to-gen'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}