# es-aggregate-error

> ES Proposal spec-compliant shim for AggregateError

Latest version **1.0.14** (published 2025-06-02) · MIT license · 0 weekly downloads

> **Native alternative:** AggregateError — Use native JavaScript (Node 15.0.0+) (https://developer.mozilla.orgGlobal_Objects/AggregateError)

## Install

```sh
npm install es-aggregate-error
pnpm add es-aggregate-error
yarn add es-aggregate-error
bun add es-aggregate-error
```

## Health

**Score 43/100 (D)** — status: stable.

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

Warnings: low downloads; no esm support.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 1.0.14 |
| Published | 2025-06-02 |
| First published | 2019-10-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/es-aggregate-error) |
| Module format | CommonJS |
| Node | >= 0.4 |
| Dependencies | 8 |
| Unpacked size | 28.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 14 |
| Author | Jordan Harband |
| Maintainers | ljharb |
| Keywords | AggregateError, Error, aggregate, errors, nativeerror, es-shim API, shim, polyfill |

## Links

- npm: https://www.npmjs.com/package/es-aggregate-error
- Repository: https://github.com/es-shims/AggregateError
- Homepage: https://github.com/es-shims/AggregateError#readme
- Issues: https://github.com/es-shims/AggregateError/issues
- Funding: https://github.com/sponsors/ljharb
- npm.io page: https://npm.io/package/es-aggregate-error

## Dependencies (8)

- [es-errors](https://npm.io/package/es-errors.md) ^1.3.0
- [globalthis](https://npm.io/package/globalthis.md) ^1.0.4
- [es-abstract](https://npm.io/package/es-abstract.md) ^1.24.0
- [function-bind](https://npm.io/package/function-bind.md) ^1.1.2
- [define-properties](https://npm.io/package/define-properties.md) ^1.2.1
- [set-function-name](https://npm.io/package/set-function-name.md) ^2.0.2
- [define-data-property](https://npm.io/package/define-data-property.md) ^1.1.4
- [has-property-descriptors](https://npm.io/package/has-property-descriptors.md) ^1.0.2

## Alternatives

- [@sentry/react-native](https://npm.io/package/@sentry/react-native.md) — 2.6M weekly downloads
- [@ardatan/aggregate-error](https://npm.io/package/@ardatan/aggregate-error.md) — 708.1K weekly downloads
- [custom-error-generator](https://npm.io/package/custom-error-generator.md) — 2.0K weekly downloads
- [@technik-sde/prosemirror-recreate-transform](https://npm.io/package/@technik-sde/prosemirror-recreate-transform.md) — 1.5K weekly downloads
- [@suchipi/error-utils](https://npm.io/package/@suchipi/error-utils.md) — 78 weekly downloads

## Recent versions

- 1.0.14 (latest) — 2025-06-02
- 1.0.13 — 2024-03-22
- 1.0.12 — 2024-02-05
- 1.0.11 — 2023-09-13
- 1.0.10 — 2023-08-27
- 1.0.9 — 2022-11-02
- 1.0.8 — 2022-05-05
- 1.0.7 — 2021-10-01
- 1.0.6 — 2021-10-01
- 1.0.5 — 2020-11-23
- 1.0.4 — 2020-08-09
- 1.0.3 — 2020-06-04
- 1.0.2 — 2019-12-14
- 1.0.1 — 2019-11-11
- 1.0.0 — 2019-10-21

## README

# es-aggregate-error <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 AggregateError. Invoke its "shim" method to shim `AggregateError` if it is unavailable or noncompliant.

This package implements the [es-shim API](https://github.com/es-shims/api) interface. It works in an ES3-supported environment, and complies with the [proposed spec](https://tc39.es/proposal-promise-any/#sec-aggregate-error-object-structure).

Most common usage:
```js
var assert = require('assert');
var AggregateError = require('es-aggregate-error');

var oneError = new RangeError('hi!');
var otherError = new EvalError('oops');
var error = new AggregateError([oneError, otherError], 'this is two kinds of errors');

assert.deepEqual(error.errors, [oneError, otherError]);
assert.equal(error.message, 'this is two kinds of errors');

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

assert.ok(new globalThis.AggregateError([]) instanceof AggregateError);
```

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

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

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