{"id":15685798,"url":"https://github.com/watson/after-all-results","last_synced_at":"2025-05-07T08:34:37.707Z","repository":{"id":57174347,"uuid":"23027470","full_name":"watson/after-all-results","owner":"watson","description":"Like after-all, but collects the results for you","archived":false,"fork":false,"pushed_at":"2015-01-31T17:04:49.000Z","size":204,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T18:52:04.802Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/watson.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":"2014-08-16T21:24:59.000Z","updated_at":"2024-07-03T17:15:12.000Z","dependencies_parsed_at":"2022-08-29T00:10:47.915Z","dependency_job_id":null,"html_url":"https://github.com/watson/after-all-results","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watson%2Fafter-all-results","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watson%2Fafter-all-results/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watson%2Fafter-all-results/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watson%2Fafter-all-results/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/watson","download_url":"https://codeload.github.com/watson/after-all-results/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252843355,"owners_count":21812862,"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":[],"created_at":"2024-10-03T17:31:13.573Z","updated_at":"2025-05-07T08:34:37.681Z","avatar_url":"https://github.com/watson.png","language":"JavaScript","funding_links":[],"categories":["Packages","包"],"sub_categories":["Control flow Callbacks","Control flow"],"readme":"# after-all-results\n\nIf you have multiple async function calls that you want to run in\nparallel and collect all their results in an array, this is the module\nfor you.\n\nIt's like [after-all](https://github.com/sorribas/after-all) with a\nbuild in results aggregator.\n\n[![build status](https://secure.travis-ci.org/watson/after-all-results.png)](http://travis-ci.org/watson/after-all-results)\n\n## Installation\n\n```\nnpm install after-all-results\n```\n\n## Usage\n\nFirst require the module:\n\n```javascript\nvar afterAll = require('after-all-results');\n```\n\nThen initialize with a callback that should be called once all the async\nstuff is done:\n\n```javascript\nvar next = afterAll(function (err, results) {\n  // all done!\n  console.log(results);\n});\n```\n\nThe returned `next` function is essentially just a smart\ncallback-generator. The after-all-results module will wait and not call\nthe all-done function until all the generated callbacks have been\ncalled:\n\n```javascript\nsomeAsyncFunction(next());\nanotherAsyncFunction(next());\n```\n\n**Note:** It is important that all `next()` calls are done on the same\ntick as the inital call to `afterAll()`!\n\n### Bonus: Inception mode\n\n```javascript\nvar next = afterAll(function (err, results) {\n  // results will be an array of `arg1` from below\n  console.log('Done with everything!');\n});\n\nasync(next(function (err, arg1, arg2) {\n  console.log('Done with first call to async');\n});\n\nasync(next(function (err, arg1, arg2) {\n  console.log('Done with second call to async');\n});\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwatson%2Fafter-all-results","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwatson%2Fafter-all-results","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwatson%2Fafter-all-results/lists"}