{"id":17398462,"url":"https://github.com/vweevers/run-parallel-settled","last_synced_at":"2026-05-03T12:37:30.845Z","repository":{"id":66220582,"uuid":"283306986","full_name":"vweevers/run-parallel-settled","owner":"vweevers","description":"Run an array of functions in parallel, wait to finish when one errors.","archived":false,"fork":false,"pushed_at":"2020-08-16T19:22:28.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-19T12:31:36.468Z","etag":null,"topics":["async","kitchen-sink","nodejs","npm-package","parallel"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vweevers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-28T19:22:36.000Z","updated_at":"2020-08-16T19:22:30.000Z","dependencies_parsed_at":"2023-03-17T12:00:45.450Z","dependency_job_id":null,"html_url":"https://github.com/vweevers/run-parallel-settled","commit_stats":{"total_commits":4,"total_committers":1,"mean_commits":4.0,"dds":0.0,"last_synced_commit":"ac78c62bee3722a5a06cd381404d54eb7c7db9a2"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/vweevers/run-parallel-settled","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vweevers%2Frun-parallel-settled","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vweevers%2Frun-parallel-settled/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vweevers%2Frun-parallel-settled/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vweevers%2Frun-parallel-settled/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vweevers","download_url":"https://codeload.github.com/vweevers/run-parallel-settled/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vweevers%2Frun-parallel-settled/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266193464,"owners_count":23890794,"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":["async","kitchen-sink","nodejs","npm-package","parallel"],"created_at":"2024-10-16T14:56:54.284Z","updated_at":"2026-05-03T12:37:25.786Z","avatar_url":"https://github.com/vweevers.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# run-parallel-settled\n\n**Run an array of functions in parallel, wait to finish when one errors.** Similar to [`run-parallel`](https://github.com/feross/run-parallel) and [`run-parallel-limit`](https://github.com/feross/run-parallel-limit) which return as soon as the first function errors, while this waits for functions that already started. Useful to ensure that once the final callback is called, any resources created by the functions have been cleaned up.\n\n[![npm status](http://img.shields.io/npm/v/run-parallel-settled.svg)](https://www.npmjs.org/package/run-parallel-settled)\n[![node](https://img.shields.io/node/v/run-parallel-settled.svg)](https://www.npmjs.org/package/run-parallel-settled)\n[![Travis build status](https://img.shields.io/travis/com/vweevers/run-parallel-settled.svg?label=travis)](http://travis-ci.com/vweevers/run-parallel-settled)\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n\n## Usage\n\n```js\nconst parallel = require('run-parallel-settled')\n\nconst tasks = [\n  function one (next) {\n    next(new Error('failed'))\n  },\n  function two (next) {\n    setTimeout(function () {\n      console.log('wait for me')\n      next(null, 123)\n    }, 1e3)\n  },\n  function three (next) {\n    next(new Error('also failed'))\n  }\n]\n\nparallel(tasks, 3, function (err, results) {\n  if (err) throw err\n})\n```\n\nThis will wait for function two, then throw a [combined error](https://github.com/vweevers/maybe-combine-errors) from one and three:\n\n```\n$ node example.js\nwait for me\n/examples/example.js:19\n  if (err) throw err\n           ^\n\nError: failed\n    at Array.one (/examples/example.js:5:10)\n    at parallel (/examples/node_modules/run-parallel-settled/index.js:27:13)\n    at ..\n\nError: also failed\n    at Array.three (/examples/example.js:14:10)\n    at parallel (/examples/node_modules/run-parallel-settled/index.js:27:13)\n    at ..\n```\n\n## API\n\n### `parallel(tasks[, limit], callback)`\n\nRun the functions in the `tasks` array, with a maximum of `limit` functions executing in parallel. The `limit` argument defaults to `Infinity` i.e. no limit. The `callback` function with signature `callback(err, results)` will be called once all functions have finished without error, or once one of them errors and all functions that were started have finished.\n\n## Install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install run-parallel-settled\n```\n\n## License\n\n[MIT](LICENSE.md) © 2020-present Vincent Weevers\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvweevers%2Frun-parallel-settled","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvweevers%2Frun-parallel-settled","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvweevers%2Frun-parallel-settled/lists"}