regenerator-runtime
The runtime library that powers Babel-compiled ES6 generator and async/await functions in ES5 environments
Repository Health
Technical Analysis
regenerator-runtime is the small (under 1KB compressed) support library required by code that the Regenerator source transform (used internally by Babel) produces when compiling ES2015 generator functions and async/await syntax down to plain ES5. Any transpiled function using yield or async/await calls into this runtime’s wrapGenerator machinery at execution time, so it must be present wherever that compiled output runs.
What You Get
- The
regeneratorRuntimeglobal (or importable module) that implements generator/iterator state-machine semantics in plain ES5 - Support for
yield,yield*delegation, andasync/await(desugared to generators) in environments without native support - A tiny (<1KB compressed) footprint since it only implements the runtime state machine, not the transform itself
- Battle-tested compatibility, since it’s the de facto runtime shipped by Babel’s own generator/async transforms across virtually the entire JS build ecosystem
Common Use Cases
- Automatically pulled in as a dependency when Babel or another compiler transpiles generator/async functions for older browser or JS engine targets
- Polyfilling generator/async support in legacy environments (old browsers, certain embedded JS engines) that lack native support
- Powering libraries and frameworks that ship pre-compiled ES5 bundles but use
async/awaitor generators internally in their source - Ensuring consistent generator/async behavior across a build’s transpiled output regardless of the target runtime’s native support level
Under The Hood
Architecture The published package’s implementation lives at packages/runtime/runtime.js (761 lines) inside the larger facebook/regenerator monorepo, which also contains the actual source-to-source regenerator transform (lib/, main.js) that rewrites function*/yield/async syntax into calls against this runtime. The runtime implements a GeneratorFunctionPrototype-like object plus a wrap() function that turns a specially-shaped compiled function body into a proper iterator object with .next()/.throw()/.return(), replicating native generator semantics entirely in ES5 JavaScript. Tech Stack Plain, dependency-free JavaScript with no build step of its own for the runtime file — it’s published essentially as-authored — while the sibling regenerator transform package (which produces code that calls into this runtime) uses Babel/AST tooling internally. Code Quality The monorepo’s test/ directory includes dedicated runtime tests (test/runtime.js) alongside broader transform conformance tests (tests.es6.js, class.js, async.js, regression.js) that exercise edge cases like frozen intrinsics and non-native environments — reflecting the runtime’s role as foundational, widely-depended-upon infrastructure where regressions have outsized blast radius. API Design Consumers essentially never call this package’s API directly by hand — it’s an implicit dependency injected by a compiler (Babel) into transpiled output, so its ‘API’ is really the internal contract between the regenerator transform and this runtime, not a public surface meant for direct human use.
Used by 15 apps in this directory
APITable
Low Code Platforms · Databases
API-first collaborative spreadsheet-database platform that auto-generates REST APIs and lets teams build internal tools, CRMs, and dashboards without code.
Amplication
Developer Tools · AI Code Assistants · Automation
Create production-ready backend services with your organization's standards baked in — generating NestJS, Prisma, and GraphQL code that you own and control.
Bigcapital
Invoicing Finance
Self-hostable double-entry accounting platform with invoicing, inventory, multi-currency, and real-time financial reporting for small and medium businesses.
BillaBear
Ecommerce · Invoicing Finance
Self-hostable subscription management and billing platform with Stripe integration, tax automation, configurable workflows, and Twig-based document generation.
Bytebase
Devops
An open-source database CI/CD and DevSecOps platform — schema migration review, GitOps-driven changes, data masking, and access control across MySQL, PostgreSQL, Oracle, Snowflake, MongoDB, and more.
Grafana
Monitoring · Analytics
The open-source observability platform that unifies metrics, logs, and traces from any data source into dynamic, queryable dashboards.
GraphQL Hive
Developer Tools · Devops · Monitoring
Open-source GraphQL schema registry and observability platform with breaking change detection, federation support, and CI/CD integration for teams of any size.
LibreChat
Developer Tools · AI Assistants
Unite every major AI model in one self-hosted chat platform with agents, code execution, MCP tools, and enterprise authentication.
Mastodon
Social Media
Run your own federated social network on the open ActivityPub standard with no ads, no algorithms, and no corporate control over your community.