# promise.allsettled

> ES Proposal spec-compliant shim for Promise.allSettled

Latest version **1.0.7** (published 2023-09-03) · MIT license · 0 weekly downloads

> **Native alternative:** Promise.allSettled — Use native JavaScript (Node 12.9.0+) (https://developer.mozilla.orgGlobal_Objects/Promise/allSettled)

## Install

```sh
npm install promise.allsettled
pnpm add promise.allsettled
yarn add promise.allsettled
bun add promise.allsettled
```

## Health

**Score 33/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2023-09-03 |
| First published | 2019-03-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/promise.allsettled) |
| Module format | CommonJS |
| Node | >= 0.4 |
| Dependencies | 6 |
| Unpacked size | 26.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 97 |
| Author | Jordan Harband |
| Maintainers | ljharb |
| Keywords | Promise, promises, allsettled, settled, fulfilled, resolved, rejected, promise.allsettled, shim, polyfill, es-shim, API |

## Links

- npm: https://www.npmjs.com/package/promise.allsettled
- Repository: https://github.com/es-shims/Promise.allSettled
- Homepage: https://github.com/es-shims/promise.allsettled#readme
- Issues: https://github.com/es-shims/promise.allsettled/issues
- Funding: https://github.com/sponsors/ljharb
- npm.io page: https://npm.io/package/promise.allsettled

## Dependencies (6)

- [call-bind](https://npm.io/package/call-bind.md) ^1.0.2
- [es-abstract](https://npm.io/package/es-abstract.md) ^1.22.1
- [get-intrinsic](https://npm.io/package/get-intrinsic.md) ^1.2.1
- [iterate-value](https://npm.io/package/iterate-value.md) ^1.0.2
- [define-properties](https://npm.io/package/define-properties.md) ^1.2.0
- [array.prototype.map](https://npm.io/package/array.prototype.map.md) ^1.0.5

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 1.0.7 (latest) — 2023-09-03
- 1.0.6 — 2022-11-07
- 1.0.5 — 2021-10-04
- 1.0.4 — 2021-01-21
- 1.0.3 — 2021-01-20
- 1.0.2 — 2019-12-13
- 1.0.1 — 2019-05-06
- 1.0.0 — 2019-03-28

## README

# promise.allsettled <sup>[![Version Badge][npm-version-svg]][package-url]</sup>

[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![dependency status][deps-svg]][deps-url]
[![dev dependency status][dev-deps-svg]][dev-deps-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]

[![npm badge][npm-badge-png]][package-url]

ES Proposal spec-compliant shim for Promise.allSettled. Invoke its "shim" method to shim `Promise.allSettled` if it is unavailable or noncompliant. **Note**: a global `Promise` must already exist: the [es6-shim](https://github.com/es-shims/es6-shim) is recommended.

This package implements the [es-shim API](https://github.com/es-shims/api) interface. It works in an ES3-supported environment that has `Promise` available globally, and complies with the [proposed spec](https://github.com/tc39/proposal-promise-allSettled).

Most common usage:
```js
var assert = require('assert');
var allSettled = require('promise.allsettled');

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

allSettled([resolved, rejected]).then(function (results) {
	assert.deepEqual(results, [
		{ status: 'fulfilled', value: 42 },
		{ status: 'rejected', reason: -1 }
	]);
});

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

Promise.allSettled([resolved, rejected]).then(function (results) {
	assert.deepEqual(results, [
		{ status: 'fulfilled', value: 42 },
		{ status: 'rejected', reason: -1 }
	]);
});
```

## Tests
Simply clone the repo, `npm install`, and run `npm test`

[package-url]: https://npmjs.com/package/promise.allsettled
[npm-version-svg]: http://versionbadg.es/es-shims/Promise.allSettled.svg
[travis-svg]: https://travis-ci.org/es-shims/Promise.allSettled.svg
[travis-url]: https://travis-ci.org/es-shims/Promise.allSettled
[deps-svg]: https://david-dm.org/es-shims/Promise.allSettled.svg
[deps-url]: https://david-dm.org/es-shims/Promise.allSettled
[dev-deps-svg]: https://david-dm.org/es-shims/Promise.allSettled/dev-status.svg
[dev-deps-url]: https://david-dm.org/es-shims/Promise.allSettled#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/promise.allsettled.png?downloads=true&stars=true
[license-image]: http://img.shields.io/npm/l/promise.allsettled.svg
[license-url]: LICENSE
[downloads-image]: http://img.shields.io/npm/dm/promise.allsettled.svg
[downloads-url]: http://npm-stat.com/charts.html?package=promise.allsettled
[codecov-image]: https://codecov.io/gh/es-shims/Promise.allSettled/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/es-shims/Promise.allSettled/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/es-shims/Promise.allSettled
[actions-url]: https://github.com/es-shims/Promise.allSettled/actions

---
_Source: https://npm.io/package/promise.allsettled · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
