{"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":{"integrity":"sha512-gOsf2YwSlleG6IjRYG2A7k0HmBMEo6qVNk9Bp/EaLgAJT5ngH6PXbqa4ItvnEwCm/velL5jAnQgsHsWnjhGmvw==","shasum":"ffe15045d7521c51c9d618e3d7f37c13f29b3fd3","tarball":"http://registry-npm.ywwl.com/aggregate-error/download/aggregate-error-5.0.0.tgz","fileCount":5,"unpackedSize":6471,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDAt3KGOV54FSfOUM2afJ6STOcGNWHHUoSN/iyFHNZYYgIgHho0xEFWARN5GU8f0R5mUWdbjXqolbOY3PnTn2IcNio="}],"size":2630,"noattachment":false,"key":"/aggregate-error/-/aggregate-error-5.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/aggregate-error_5.0.0_1694674406975_0.13624717446079826"},"_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","publish_time":1694674407142,"_cnpm_publish_time":1694674407142,"dist-tags":{"latest":"5.1.0"}}