{"_id":"aggregate-error","_rev":"3793474","name":"aggregate-error","description":"Create an error from multiple errors","dist-tags":{"latest":"5.0.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2025-06-05T10:26:08.000Z","created":"2016-09-13T05:00:15.085Z","5.0.0":"2023-09-14T06:53:27.142Z","4.0.1":"2022-05-08T15:23:35.349Z","4.0.0":"2021-04-17T17:40:14.142Z","3.1.0":"2020-08-21T22:29:47.896Z","3.0.1":"2019-10-04T05:44:57.514Z","3.0.0":"2019-04-01T09:36:00.231Z","2.2.0":"2019-03-03T11:30:41.065Z","2.1.0":"2019-02-28T16:57:40.566Z","2.0.0":"2018-12-26T16:59:33.172Z","1.0.0":"2017-01-13T10:09:54.467Z","0.1.0":"2016-09-13T05:00:15.085Z"},"users":{},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/aggregate-error.git"},"versions":{"5.0.0":{"name":"aggregate-error","version":"5.0.0","description":"Create an error from multiple errors","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/aggregate-error.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"engines":{"node":">=18"},"scripts":{"test":"xo && ava && tsd"},"keywords":["aggregate","error","combine","multiple","many","collection","iterable","iterator"],"dependencies":{"clean-stack":"^5.2.0","indent-string":"^5.0.0"},"devDependencies":{"ava":"^5.3.1","tsd":"^0.29.0","xo":"^0.56.0"},"types":"./index.d.ts","gitHead":"8b09cac27a528035d450134192cdc3a51d878fdd","bugs":{"url":"https://github.com/sindresorhus/aggregate-error/issues"},"homepage":"https://github.com/sindresorhus/aggregate-error#readme","_id":"aggregate-error@5.0.0","_nodeVersion":"18.16.1","_npmVersion":"9.2.0","dist":{"shasum":"ffe15045d7521c51c9d618e3d7f37c13f29b3fd3","size":2630,"noattachment":false,"key":"/aggregate-error/-/aggregate-error-5.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/aggregate-error/download/aggregate-error-5.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/aggregate-error_5.0.0_1694674406975_0.13624717446079826"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-09-14T06:53:27.142Z","publish_time":1694674407142,"_source_registry_name":"default","_cnpm_publish_time":1694674407142},"4.0.1":{"name":"aggregate-error","version":"4.0.1","description":"Create an error from multiple errors","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/aggregate-error.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":">=12"},"scripts":{"//test":"xo && ava && tsd","test":"ava && tsd"},"keywords":["aggregate","error","combine","multiple","many","collection","iterable","iterator"],"dependencies":{"clean-stack":"^4.0.0","indent-string":"^5.0.0"},"devDependencies":{"ava":"^3.15.0","tsd":"^0.14.0","xo":"^0.38.2"},"types":"./index.d.ts","gitHead":"9b3a3f61ce85831cf61e8350b158de3ef4f8a1bd","bugs":{"url":"https://github.com/sindresorhus/aggregate-error/issues"},"homepage":"https://github.com/sindresorhus/aggregate-error#readme","_id":"aggregate-error@4.0.1","_nodeVersion":"14.19.1","_npmVersion":"8.3.2","dist":{"shasum":"25091fe1573b9e0be892aeda15c7c66a545f758e","size":2619,"noattachment":false,"key":"/aggregate-error/-/aggregate-error-4.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/aggregate-error/download/aggregate-error-4.0.1.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/aggregate-error_4.0.1_1652023415165_0.6379571805726236"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-05-08T15:23:40.935Z","publish_time":1652023415349,"_cnpm_publish_time":1652023415349},"4.0.0":{"name":"aggregate-error","version":"4.0.0","description":"Create an error from multiple errors","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/aggregate-error.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":">=12"},"scripts":{"//test":"xo && ava && tsd","test":"ava && tsd"},"keywords":["aggregate","error","combine","multiple","many","collection","iterable","iterator"],"dependencies":{"clean-stack":"^4.0.0","indent-string":"^5.0.0"},"devDependencies":{"ava":"^3.15.0","tsd":"^0.14.0","xo":"^0.38.2"},"gitHead":"b8ea765c9b6b8b1263beceac7907933ff5e3b8bb","bugs":{"url":"https://github.com/sindresorhus/aggregate-error/issues"},"homepage":"https://github.com/sindresorhus/aggregate-error#readme","_id":"aggregate-error@4.0.0","_nodeVersion":"12.22.1","_npmVersion":"6.14.10","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"83dbdb53a0d500721281d22e19eee9bc352a89cd","size":2623,"noattachment":false,"key":"/aggregate-error/-/aggregate-error-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/aggregate-error/download/aggregate-error-4.0.0.tgz"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/aggregate-error_4.0.0_1618681214009_0.4768090732242849"},"_hasShrinkwrap":false,"publish_time":1618681214142,"_cnpm_publish_time":1618681214142},"3.1.0":{"name":"aggregate-error","version":"3.1.0","description":"Create an error from multiple errors","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/aggregate-error.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["aggregate","error","combine","multiple","many","collection","iterable","iterator"],"dependencies":{"clean-stack":"^2.0.0","indent-string":"^4.0.0"},"devDependencies":{"ava":"^2.4.0","tsd":"^0.7.1","xo":"^0.25.3"},"gitHead":"d5bb4ac02a43f005ec7ad45f6e62919d7ebed0e5","bugs":{"url":"https://github.com/sindresorhus/aggregate-error/issues"},"homepage":"https://github.com/sindresorhus/aggregate-error#readme","_id":"aggregate-error@3.1.0","_nodeVersion":"12.18.2","_npmVersion":"6.14.7","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"92670ff50f5359bdb7a3e0d40d0ec30c5737687a","size":2651,"noattachment":false,"key":"/aggregate-error/-/aggregate-error-3.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/aggregate-error/download/aggregate-error-3.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/aggregate-error_3.1.0_1598048987681_0.46546411856751524"},"_hasShrinkwrap":false,"publish_time":1598048987896,"_cnpm_publish_time":1598048987896},"3.0.1":{"name":"aggregate-error","version":"3.0.1","description":"Create an error from multiple errors","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/aggregate-error.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["aggregate","error","combine","multiple","many","collection","iterable","iterator"],"dependencies":{"clean-stack":"^2.0.0","indent-string":"^4.0.0"},"devDependencies":{"ava":"^2.4.0","tsd":"^0.7.1","xo":"^0.25.3"},"gitHead":"58a3c04da70abd6e4795a0bc77dcd173dd86050a","bugs":{"url":"https://github.com/sindresorhus/aggregate-error/issues"},"homepage":"https://github.com/sindresorhus/aggregate-error#readme","_id":"aggregate-error@3.0.1","_nodeVersion":"10.16.3","_npmVersion":"6.11.3","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"db2fe7246e536f40d9b5442a39e117d7dd6a24e0","size":2642,"noattachment":false,"key":"/aggregate-error/-/aggregate-error-3.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/aggregate-error/download/aggregate-error-3.0.1.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/aggregate-error_3.0.1_1570167897389_0.07256851381959772"},"_hasShrinkwrap":false,"publish_time":1570167897514,"_cnpm_publish_time":1570167897514},"3.0.0":{"name":"aggregate-error","version":"3.0.0","description":"Create an error from multiple errors","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/aggregate-error.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["aggregate","error","err","combine","multiple","many","collection","iterable","iterator"],"dependencies":{"clean-stack":"^2.0.0","indent-string":"^3.2.0"},"devDependencies":{"ava":"^1.4.1","tsd":"^0.7.1","xo":"^0.24.0"},"gitHead":"58527b529942a08301dea2c25f5cabd4be8cb459","bugs":{"url":"https://github.com/sindresorhus/aggregate-error/issues"},"homepage":"https://github.com/sindresorhus/aggregate-error#readme","_id":"aggregate-error@3.0.0","_nodeVersion":"8.15.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"5b5a3c95e9095f311c9ab16c19fb4f3527cd3f79","size":2673,"noattachment":false,"key":"/aggregate-error/-/aggregate-error-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/aggregate-error/download/aggregate-error-3.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/aggregate-error_3.0.0_1554111360019_0.2421466430836683"},"_hasShrinkwrap":false,"publish_time":1554111360231,"_cnpm_publish_time":1554111360231},"2.2.0":{"name":"aggregate-error","version":"2.2.0","description":"Create an error from multiple errors","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/aggregate-error.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=6"},"scripts":{"test":"xo && ava && tsd-check"},"keywords":["aggregate","error","err","combine","multiple","many","collection","iterable","iterator"],"dependencies":{"clean-stack":"^2.0.0","indent-string":"^3.0.0"},"devDependencies":{"ava":"^1.2.1","tsd-check":"^0.3.0","xo":"^0.24.0"},"gitHead":"9a6e8455e58015a6415ac3b8ef7f7396d2dcf6a2","bugs":{"url":"https://github.com/sindresorhus/aggregate-error/issues"},"homepage":"https://github.com/sindresorhus/aggregate-error#readme","_id":"aggregate-error@2.2.0","_nodeVersion":"10.15.1","_npmVersion":"6.8.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"f54b464db18cc77c907ae084451f39134707134a","size":2558,"noattachment":false,"key":"/aggregate-error/-/aggregate-error-2.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/aggregate-error/download/aggregate-error-2.2.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/aggregate-error_2.2.0_1551612640917_0.1653191999840251"},"_hasShrinkwrap":false,"publish_time":1551612641065,"_cnpm_publish_time":1551612641065},"2.1.0":{"name":"aggregate-error","version":"2.1.0","description":"Create an error from multiple errors","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/aggregate-error.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=6"},"scripts":{"test":"xo && ava"},"keywords":["aggregate","error","err","combine","multiple","many","collection","iterable","iterator"],"dependencies":{"clean-stack":"^2.0.0","indent-string":"^3.0.0"},"devDependencies":{"ava":"^1.2.1","xo":"^0.24.0"},"gitHead":"00dd2dc1310322217ac01d7d2b6b85df1261c1bf","bugs":{"url":"https://github.com/sindresorhus/aggregate-error/issues"},"homepage":"https://github.com/sindresorhus/aggregate-error#readme","_id":"aggregate-error@2.1.0","_nodeVersion":"10.15.1","_npmVersion":"6.8.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"051a9a733ad2e95ab503d84fb81989e6419b8f09","size":2364,"noattachment":false,"key":"/aggregate-error/-/aggregate-error-2.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/aggregate-error/download/aggregate-error-2.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/aggregate-error_2.1.0_1551373060354_0.9604693349380302"},"_hasShrinkwrap":false,"publish_time":1551373060566,"_cnpm_publish_time":1551373060566},"2.0.0":{"name":"aggregate-error","version":"2.0.0","description":"Create an error from multiple errors","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/aggregate-error.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=6"},"scripts":{"test":"xo && ava"},"keywords":["aggregate","error","err","combine","multiple","many","collection","iterable","iterator"],"dependencies":{"clean-stack":"^2.0.0","indent-string":"^3.0.0"},"devDependencies":{"ava":"^1.0.1","xo":"^0.23.0"},"gitHead":"6faf66970598a9dbae497fb23420c4ce50be1097","bugs":{"url":"https://github.com/sindresorhus/aggregate-error/issues"},"homepage":"https://github.com/sindresorhus/aggregate-error#readme","_id":"aggregate-error@2.0.0","_npmVersion":"6.5.0","_nodeVersion":"8.12.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"65bd82beba40097eacb2f1077a5b55c593b18abc","size":2295,"noattachment":false,"key":"/aggregate-error/-/aggregate-error-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/aggregate-error/download/aggregate-error-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/aggregate-error_2.0.0_1545843573001_0.9201395297090222"},"_hasShrinkwrap":false,"publish_time":1545843573172,"_cnpm_publish_time":1545843573172},"1.0.0":{"name":"aggregate-error","version":"1.0.0","description":"Create an error from multiple errors","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/aggregate-error.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["aggregate","error","err","combine","multiple","many","collection","iterable","iterator"],"dependencies":{"clean-stack":"^1.0.0","indent-string":"^3.0.0"},"devDependencies":{"ava":"*","xo":"*"},"gitHead":"dc4c1bffe452a1e18dd1f0ced2aaf46d37d38048","bugs":{"url":"https://github.com/sindresorhus/aggregate-error/issues"},"homepage":"https://github.com/sindresorhus/aggregate-error#readme","_id":"aggregate-error@1.0.0","_shasum":"888344dad0220a72e3af50906117f48771925fac","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.6.2","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"888344dad0220a72e3af50906117f48771925fac","size":2202,"noattachment":false,"key":"/aggregate-error/-/aggregate-error-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/aggregate-error/download/aggregate-error-1.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/aggregate-error-1.0.0.tgz_1484302194233_0.6430134251713753"},"directories":{},"publish_time":1484302194467,"_cnpm_publish_time":1484302194467,"_hasShrinkwrap":false},"0.1.0":{"name":"aggregate-error","version":"0.1.0","description":"Create an error from multiple errors","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/aggregate-error.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["aggregate","error","err","combine","multiple","many","collection","iterable","iterator"],"dependencies":{"clean-stack":"^1.0.0","indent-string":"^3.0.0"},"devDependencies":{"ava":"*","xo":"*"},"xo":{"esnext":true},"gitHead":"9579faa6988a5c7485f91082fe940a397d953b64","bugs":{"url":"https://github.com/sindresorhus/aggregate-error/issues"},"homepage":"https://github.com/sindresorhus/aggregate-error#readme","_id":"aggregate-error@0.1.0","_shasum":"977166c896cbeaa1b56e593096244ff184adafb0","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.5.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"977166c896cbeaa1b56e593096244ff184adafb0","size":2224,"noattachment":false,"key":"/aggregate-error/-/aggregate-error-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/aggregate-error/download/aggregate-error-0.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/aggregate-error-0.1.0.tgz_1473742812143_0.5017943645361811"},"directories":{},"publish_time":1473742815085,"_cnpm_publish_time":1473742815085,"_hasShrinkwrap":false}},"readme":"# aggregate-error\n\n> Create an error from multiple errors\n\n*Note: With [Node.js 15](https://medium.com/@nodejs/node-js-v15-0-0-is-here-deb00750f278), there's now a built-in [`AggregateError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AggregateError) type.*\n\n## Install\n\n```sh\nnpm install aggregate-error\n```\n\n## Usage\n\n```js\nimport AggregateError from 'aggregate-error';\n\nconst error = new AggregateError([new Error('foo'), 'bar', {message: 'baz'}]);\n\nthrow error;\n/*\nAggregateError:\n    Error: foo\n        at Object.<anonymous> (/Users/sindresorhus/dev/aggregate-error/example.js:3:33)\n    Error: bar\n        at Object.<anonymous> (/Users/sindresorhus/dev/aggregate-error/example.js:3:13)\n    Error: baz\n        at Object.<anonymous> (/Users/sindresorhus/dev/aggregate-error/example.js:3:13)\n    at AggregateError (/Users/sindresorhus/dev/aggregate-error/index.js:19:3)\n    at Object.<anonymous> (/Users/sindresorhus/dev/aggregate-error/example.js:3:13)\n    at Module._compile (module.js:556:32)\n    at Object.Module._extensions..js (module.js:565:10)\n    at Module.load (module.js:473:32)\n    at tryModuleLoad (module.js:432:12)\n    at Function.Module._load (module.js:424:3)\n    at Module.runMain (module.js:590:10)\n    at run (bootstrap_node.js:394:7)\n    at startup (bootstrap_node.js:149:9)\n*/\n\nfor (const individualError of error.errors) {\n\tconsole.log(individualError);\n}\n//=> [Error: foo]\n//=> [Error: bar]\n//=> [Error: baz]\n```\n\n## API\n\n### AggregateError(errors)\n\nReturns an `Error`.\n\n#### errors\n\nType: `Array<Error|object|string>`\n\nIf a string, a new `Error` is created with the string as the error message.\\\nIf a non-Error object, a new `Error` is created with all properties from the object copied over.\n","_attachments":{},"homepage":"https://github.com/sindresorhus/aggregate-error#readme","bugs":{"url":"https://github.com/sindresorhus/aggregate-error/issues"},"license":"MIT"}