Version 1.0.2
@stackline/es6-promise
A lightweight library that provides tools for organizing asynchronous code
Independent maintenance of es6-promise 4.2.8. Original authors and licenses are retained.
Installation
# Preserve existing imports with an npm alias
npm install es6-promise@npm:@stackline/es6-promise@1.0.2
# Or use the scoped package name in your imports
npm install @stackline/es6-promise@1.0.2Node.js: See compatibility notes. Read the compatibility and maintenance notes before migrating.
Usage and API
@stackline/es6-promise
A lightweight library that provides tools for organizing asynchronous code.
Documentation | npm | Issues | Repository
Current package version: 1.0.2
Why this package?
@stackline/es6-promise is the Stackline-maintained distribution of es6-promise@4.2.8. It is an independent continuation of es6-promise; original authors and licenses remain credited below.
Compatibility
| Item | Value |
|---|---|
| Package | @stackline/es6-promise@1.0.2 |
| API target | es6-promise@4.2.8 |
| Supported Node.js | See supported framework requirements |
| License | MIT |
| Main entry | dist/es6-promise.js |
| Types | es6-promise.d.ts |
| Runtime dependencies | none |
Installation
npm install @stackline/es6-promise
Preserve existing imports and plugin resolution with an npm alias:
npm install es6-promise@npm:@stackline/es6-promise
Usage and API reference
ES6-Promise (subset of rsvp.js) 
This is a polyfill of the ES6 Promise. The implementation is a subset of rsvp.js extracted by @jakearchibald, if you're wanting extra features and more debugging options, check out the full library.
For API details and how to use promises, see the JavaScript Promises HTML5Rocks article.
Downloads
- es6-promise 27.86 KB (7.33 KB gzipped)
- es6-promise-auto 27.78 KB (7.3 KB gzipped) - Automatically provides/replaces
Promiseif missing or broken. - es6-promise-min 6.17 KB (2.4 KB gzipped)
- es6-promise-auto-min 6.19 KB (2.4 KB gzipped) - Minified version of
es6-promise-autoabove.
CDN
To use via a CDN include this in your html:
<script src="https://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.js"></script>
<script src="https://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.auto.js"></script>
<script src="https://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.auto.min.js"></script>
Node.js
To install:
yarn add @stackline/es6-promise
or
npm install @stackline/es6-promise
To use:
var Promise = require('@stackline/es6-promise').Promise;
Usage in IE<9
catch and finally are reserved keywords in IE<9, meaning
promise.catch(func) or promise.finally(func) throw a syntax error. To work
around this, you can use a string to access the property as shown in the
following example.
However most minifiers will automatically fix this for you, making the resulting code safe for old browsers and production:
promise['catch'](function(err) {
// ...
});
promise['finally'](function() {
// ...
});
Auto-polyfill
To polyfill the global environment (either in Node or in the browser via CommonJS) use the following code snippet:
require('@stackline/es6-promise').polyfill();
Alternatively
require('es6-promise/auto');
Notice that we don't assign the result of polyfill() to any variable. The polyfill() method will patch the global environment (in this case to the Promise name) when called.
Building & Testing
You will need to have PhantomJS installed globally in order to run the tests.
npm install -g phantomjs
npm run buildto buildnpm testto run testsnpm startto run a build watcher, and webserver to testnpm run test:serverfor a testem test runner and watching builder
Credits and original authors
- Original project: es6-promise.
- Yehuda Katz, Tom Dale, Stefan Penner and contributors.
- Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors.
- Stackline maintenance: Alexandro Paixao Marques and Stackline contributors.
Original copyright, license notices and contributor acknowledgements remain part of this distribution. Stackline maintenance does not replace authorship of the original work.
License
MIT. See the license and notice files in the repository.
Community and Links
Use this repository's issue tracker for reproducible bugs and feature requests. Join r/Stackline for examples, usage questions and release discussions.
Upstream issues and maintenance review
Upstream review
Source: es6-promise@4.2.8, 1e68dce6f674e5613f4a1797aedd55dc70ac1dcb. Published upstream source files match the integrity-verified npm tarball. Generated distributions are rebuilt using current development tools; original library source, license and API contracts are retained.
Issue review (2026-09-29)
- #354: Promise.allSettled request: Keep the original ES6 Promise API. Do not claim new ES2020 allSettled support.
- #365: IE11/Babel integration: Build all normal/auto/minified UMD outputs as ES5, parse them as ES5 and execute auto-polyfill in real Chromium. Historical IE11 itself is not available for a live browser test.
- #324: Default require export: Verify the CommonJS constructor remains the default export and .Promise refers to that constructor.
No upstream maintainer was contacted. These are scoped compatibility decisions rather than claims that every issue was solved.
Verification
Run npm ci --ignore-scripts, npm run build, npm test, npm run test:package, and npm audit --audit-level=low. CI and CodeQL must pass before the exact built tarball is published with provenance.
The original scheduler and Promise extension suites execute unchanged with a current Mocha runner. The obsolete PhantomJS/Ember test wrapper is replaced by direct Node tests and a real Chromium auto-polyfill check. The historical PhantomJS-specific Promises/A+ wrapper is not represented as a newly executed certification suite.
Release changes
Stackline changes
1.0.0
- Scoped maintenance release preserving upstream library sources, exports, dependency ranges and supported runtime engines.
- Replaced obsolete development bundlers/runners with current Rollup and Mocha, retaining upstream runtime tests and published module formats.
- Added installed-tarball contracts, audited CI/CodeQL and artifact-only provenance/immutable releases.
Master
4.2.5
- remove old try/catch performance hacks, modern runtimes do not require these tricks
4.2.4
- [Fixes #305] Confuse webpack
4.2.3
- Cleanup testem related build configuration
- Use
prepublishOnlyinstead ofprepublish(thanks @rhysd) - Add Node.js 9, 8 to testing matrix
- drop now unused s3 deployment files
- internal cleanup (thanks to @bekzod, @mariusschulz)
- Fixup Changelog
4.2.2
- Ensure PROMISE_ID works correctly
- internal cleanup (thanks yo @mariusschulz)
4.2.1
- drop bower support
4.2.0
- drop
distfrom git repo - add
Promise.prototype.finally - update various build related dependencies
- add CDN links
4.1.0
- [BUGFIX] Fix memory leak [#269]
- [BUGFIX] Auto Bundles within an AMD Environment [#263]
4.0.5
- fix require('es6-promise/auto') for Node < 4
4.0.4
- fix asap when using https://github.com/Kinvey/titanium-sdk
4.0.3
- fix Readme links
4.0.2
- fix require('es6-promise/auto');
4.0.0
- no longer polyfill automatically, if needed one can still invoke
require('es6-promise/auto')directly.
3.3.1
- fix links in readme
3.3.0
- support polyfil on WebMAF (playstation env)
- fix tampering related bug global
constructorwas referenced by mistake. - provide TS Typings
- increase compatibliity with sinon.useFakeTimers();
- update build tools (use rollup)
- directly export promise;
3.2.2
- IE8: use isArray
- update build dependencies
3.2.1
- fix race tampering issue
- use eslint
- fix Promise.all tampering
- remove unused code
- fix issues with NWJS/electron
3.2.0
- improve tamper resistence of Promise.all Promise.race and Promise.prototype.then (note, this isn't complete, but addresses an exception when used \w core-js, follow up work will address entirely)
- remove spec incompatible then chaining fast-path
- add eslint
- update build deps
3.1.2
- fix node detection issues with NWJS/electron
3.1.0
- improve performance of Promise.all when it encounters a non-promise input object input
- then/resolve tamper protection
- reduce AST size of promise constructor, to facilitate more inlining
- Update README.md with details about PhantomJS requirement for running tests
- Mangle and compress the minified version
3.0.2
- correctly bump both bower and package.json versions
3.0.1
- no longer include dist/test in npm releases
3.0.0
use nextTick() instead of setImmediate() to schedule microtasks with node 0.10. Later versions of nodes are not affected as they were already using nextTick(). Note that using nextTick() might trigger a depreciation warning on 0.10 as described at https://github.com/cujojs/when/issues/410. The reason why nextTick() is preferred is that is setImmediate() would schedule a macrotask instead of a microtask and might result in a different scheduling. If needed you can revert to the former behavior as follow:
var Promise = require('es6-promise').Promise; Promise._setScheduler(setImmediate);
2.3.0
- #121: Ability to override the internal asap implementation
- #120: Use an ascii character for an apostrophe, for source maps
2.2.0
- #116: Expose asap() and a way to override the scheduling mechanism on Promise
- Lock to v0.2.3 of ember-cli
2.1.1
- Fix #100 via #105: tell browserify to ignore vertx require
- Fix #101 via #102: "follow thenable state, not own state"
2.1.0
- #59: Automatic polyfill. No need to invoke
ES6Promise.polyfill()anymore. - ... (see the commit log)
2.0.0
- re-sync with RSVP. Many large performance improvements and bugfixes.
1.0.0
- first subset of RSVP
Release files and references
- README.md
- UPSTREAM.md
- CHANGELOG.md
- LICENSE
- NOTICE
- Package and publication metadata
- Full text documentation
Package bytes, npm provenance and the immutable GitHub release were verified for this version. Security checks describe the reviewed release; documented compatibility risks and upstream reports are not blanket claims of resolution.