Skip to content
ES Proposal spec-compliant shim for Promise.any
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Only apps should have lockfiles Sep 2, 2019
LICENSE npm init Sep 2, 2019
implementation.js implementation Sep 2, 2019
index.js implementation Sep 2, 2019
polyfill.js implementation Sep 2, 2019
requirePromise.js implementation Sep 2, 2019

promise.any Version Badge

Build Status dependency status dev dependency status License Downloads

npm badge

ES Proposal spec-compliant shim for Promise.any. Invoke its "shim" method to shim Promise.any if it is unavailable or noncompliant. Note: a global Promise must already exist: the es6-shim is recommended.

This package implements the es-shim API interface. It works in an ES3-supported environment that has Promise available globally, and complies with the proposed spec.

Most common usage:

var assert = require('assert');
var any = require('promise.any');

var resolved = Promise.resolve(42);
var rejected = Promise.reject(-1);
var alsoRejected = Promise.reject(Infinity);

any([resolved, rejected, alsoRejected]).then(function (result) {
	assert.equal(result, 42);

any([rejected, alsoRejected]).catch(function (results) {
	assert.deepEqual(results, [-1, Infinity]);

any.shim(); // will be a no-op if not needed

Promise.any([resolved, rejected, alsoRejected]).then(function (result) {
	assert.equal(result, 42);

Promise.any([rejected, alsoRejected]).catch(function (results) {
	assert.deepEqual(results, [-1, Infinity]);


Simply clone the repo, npm install, and run npm test

Pre-1.0 versions

The promise.any package was released as now-deprecated v0.1.0 and v0.1.1, as a fork of

Thanks to @sadorlovsky for donating the repo and the promise.any npm package!

You can’t perform that action at this time.