es6-promise
Lightweight, spec-compliant Promise/A+ polyfill for pre-ES6 environments
Repository Health
Technical Analysis
es6-promise is a tiny, standards-compliant implementation of the ES6 Promise specification, built on top of the RSVP.js promise library. It exists to give browsers and JavaScript runtimes that predate native Promise support (older browsers, some embedded/legacy environments) an identical, spec-conformant Promise global, so code written against the native Promise API works unmodified.
The package offers both a Promise export for manual use and an es6-promise/auto entry point that polyfills the global Promise automatically if it’s missing. It passes the full Promises/A+ conformance test suite and was historically bundled by major frameworks (including early Ember.js and Vue CLI targets) as their default Promise polyfill before native support became universal.
What You Get
- A
Promiseconstructor matching the ES6 specification, built on the battle-tested RSVP.js implementation - An
es6-promise/automodule that polyfillswindow.Promise/global.Promiseautomatically when missing - Full Promises/A+ test-suite conformance
- Prebuilt UMD, CommonJS, and minified browser bundles for direct
<script>inclusion - TypeScript type definitions (
es6-promise.d.ts)
Common Use Cases
- Polyfilling Promise support for legacy browser targets (older IE, older mobile browsers)
- Ensuring consistent Promise behavior across environments with partial or non-standard native implementations
- Being bundled as a dependency by other libraries/frameworks that need to guarantee Promise availability
- Providing a reliable Promise implementation in constrained or embedded JavaScript runtimes
Under The Hood
Architecture - The implementation is a self-contained module under lib/es6-promise/: promise.js defines the public Promise class, delegating resolution/rejection scheduling to -internal.js and enumerator.js (which implements Promise.all/Promise.race semantics), while asap.js implements the microtask scheduler used to defer callback execution to match spec-mandated async timing. polyfill.js is a thin wrapper that only assigns the implementation to the global scope if a conformant native Promise isn’t already present, and es6-promise.auto.js re-exports the library with the polyfill applied eagerly on import.
Tech Stack - Plain ES5-targeted JavaScript (transpiled from newer syntax via Babel 6 plugins) built with Broccoli as the build pipeline, producing UMD/CJS/minified browser bundles. Tests run via Testem across multiple browser/Node targets, driven by the standard promises-aplus-tests conformance suite plus custom scheduler and extension tests.
Code Quality - The library is validated against the official Promises/A+ compliance test suite (test/test-adapter.js), which is the strongest correctness signal a Promise implementation can have, plus additional scheduler-specific and extension-behavior tests. The codebase is small, stable, and hasn’t needed structural changes in years since the ES6 Promise spec it implements is itself frozen.
API Design - The API is intentionally identical to native Promise, so there is zero learning curve for anyone who knows JavaScript Promises — new Promise((resolve, reject) => {}), .then(), .catch(), Promise.all(), and Promise.race() all behave exactly as spec’d. The only decision a consumer makes is require('es6-promise') (manual, opt-in polyfilling) vs. require('es6-promise/auto') (immediate global polyfill).
Used by 3 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.
Akaunting
Invoicing Finance
Open-source online accounting for small businesses and freelancers — invoices, expenses, and reporting without monthly fees or vendor lock-in.
overleaf
Collaboration · Productivity
Open-source, real-time collaborative LaTeX editor with sandboxed compilation and full TeXLive support for self-hosted academic and research teams.