Babel preset for easily using regenerator-transform to compile generator and async functions to ES5-compatible code. Current version 0.14.1. Release cadence is slow, primarily updated alongside the broader regenerator project. Key differentiator: provides a simple Babel preset wrapper around regenerator-transform, simplifying configuration compared to manually enabling the transform plugin. Alternatives include using @babel/plugin-transform-regenerator directly.
npm install regenerator-presetVerified import paths — ran on the pinned version, not inferred.
Shows how to configure Babel to use regenerator-preset for transforming async/generator functions.
Add regenerator-runtime as a dependency and import it in your entry file.
Use @babel/preset-env with "useBuiltIns": "usage" to automatically include regenerator-runtime.
Explicitly set options in your Babel config if needed: ['regenerator-preset', { 'asyncGenerators': true }].Install regenerator-runtime and import it: npm install regenerator-runtime; then add import 'regenerator-runtime/runtime';
Ensure regenerator-preset is in your Babel presets array and that Babel is configured to run on the file.