regenerator-runtime

The runtime library that powers Babel-compiled ES6 generator and async/await functions in ES5 environments

Library
npm
v0.14.1
3,822 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
49 /100 Fair
Development Activity 0
Maintenance 20
Community 76
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
61 /100 Good
Architecture 70
Code Quality 72
Innovation 60
Learning Curve 40

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 regeneratorRuntime global (or importable module) that implements generator/iterator state-machine semantics in plain ES5
  • Support for yield, yield* delegation, and async/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/await or 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

TypeScript
51%
Other

Mattermost

Collaboration · Devops · Team Chat

39,418

Open core, self-hosted team collaboration with chat, AI agents, voice calling, and deep DevOps integrations — all under your control.

View details
96
Repo Health
87
Technical
65
Dependency
Built with
TypeScript 51%
Go 40%
Updated 6 days ago
TypeScript
92%
Other

n8n

Automation · No Code Platforms

208,437

Code when you need it, UI when you don't — the workflow automation platform built for technical teams who refuse to choose.

View details
95
Repo Health
87
Technical
62
Dependency
Built with
TypeScript 92%
Updated 1 weeks ago
TypeScript
83%
AGPL 3.0

Standard Notes

Note Taking

6,681

End-to-end encrypted notes and files — private by design, built to last, and fully self-hostable.

View details
89
Repo Health
83
Technical
68
Dependency
Built with
TypeScript 83%
JavaScript 14%
Updated 1 weeks ago
TypeScript
97%
Apache 2.0

Unleash

Ab Testing Experimentation · Developer Tools · Devops

13,899

The open-source feature management platform that lets you ship code to production and control who sees it — without redeploying.

View details
91
Repo Health
84
Technical
69
Dependency
Built with
TypeScript 97%
Updated 1 weeks ago
PHP
84%
MIT

wallabag

Bookmarks Archiving

13,023

Self-hosted read-it-later app that saves clean, ad-free articles from any webpage for distraction-free reading across all your devices.

View details
93
Repo Health
81
Technical
60
Dependency
Built with
PHP 84%
Twig 13%
Updated 1 weeks ago
Python
57%
Apache 2.0

Zulip

Team Chat

26,102

Topic-based team chat that brings the structure of email threads to real-time messaging, so distributed teams never lose context across hundreds of concurrent conversations.

View details
96
Repo Health
86
Technical
60
Dependency
Built with
Python 57%
TypeScript 19%
JavaScript 11%
Updated 1 weeks ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers