{"id":17802691,"url":"https://github.com/stefee/promise-settled-aggregate","last_synced_at":"2025-04-02T04:41:40.713Z","repository":{"id":45608549,"uuid":"396341985","full_name":"stefee/promise-settled-aggregate","owner":"stefee","description":"Await an array of promises to be settled, then reject with an AggregateError upon failure, or resolve with an array of values upon success.","archived":false,"fork":false,"pushed_at":"2022-03-05T19:30:43.000Z","size":4333,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T03:44:52.203Z","etag":null,"topics":["aggregate","aggregateerror","allsettled","promise","promises","reject","settled"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stefee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-08-15T12:21:29.000Z","updated_at":"2023-05-21T00:23:08.000Z","dependencies_parsed_at":"2022-09-07T21:01:25.988Z","dependency_job_id":null,"html_url":"https://github.com/stefee/promise-settled-aggregate","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefee%2Fpromise-settled-aggregate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefee%2Fpromise-settled-aggregate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefee%2Fpromise-settled-aggregate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefee%2Fpromise-settled-aggregate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stefee","download_url":"https://codeload.github.com/stefee/promise-settled-aggregate/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246364629,"owners_count":20765506,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aggregate","aggregateerror","allsettled","promise","promises","reject","settled"],"created_at":"2024-10-27T12:44:16.920Z","updated_at":"2025-04-02T04:41:40.693Z","avatar_url":"https://github.com/stefee.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# promise-settled-aggregate\n\n\u003e Await an array of promises to be settled, then reject with an AggregateError upon failure, or resolve with an array of values upon success.\n\nIt works like [Promise.allSettled](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/allSettled) except it will reject with an [AggregateError](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AggregateError) if some of the promises are rejected, otherwise it resolves with the fulfilled values like [Promise.all](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all).\n\n```js\ntry {\n  const [a, b, c, d] = await promiseSettledAggregate([\n    Promise.reject(new Error(\"Boom\")),\n    Promise.resolve(2),\n    Promise.resolve(true),\n    Promise.reject(new Error(\"Pow\")),\n  ]);\n} catch (err) {\n  err.errors.forEach(console.error);\n}\n```\n\nYou may copy [the source code](https://github.com/stefee/promise-settled-aggregate/blob/main/promiseSettledAggregate.ts) (see [dist](./dist) for JS) directly into your project as this library is published under the Unlicense license.\n\nYou can also install it as a npm dependency:\n\n```\nnpm install promise-settled-aggregate\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefee%2Fpromise-settled-aggregate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstefee%2Fpromise-settled-aggregate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefee%2Fpromise-settled-aggregate/lists"}