{"id":15354928,"url":"https://github.com/capaj/batched-promise-all","last_synced_at":"2025-04-15T06:21:19.260Z","repository":{"id":42759418,"uuid":"278448815","full_name":"capaj/batched-promise-all","owner":"capaj","description":"a small utility for awaiting lots of promises easily","archived":false,"fork":false,"pushed_at":"2023-01-07T19:58:35.000Z","size":1567,"stargazers_count":2,"open_issues_count":13,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-14T18:38:26.863Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/capaj.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":"2020-07-09T19:07:15.000Z","updated_at":"2024-04-19T10:37:49.000Z","dependencies_parsed_at":"2023-02-08T00:02:09.138Z","dependency_job_id":null,"html_url":"https://github.com/capaj/batched-promise-all","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capaj%2Fbatched-promise-all","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capaj%2Fbatched-promise-all/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capaj%2Fbatched-promise-all/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capaj%2Fbatched-promise-all/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/capaj","download_url":"https://codeload.github.com/capaj/batched-promise-all/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240280932,"owners_count":19776415,"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-01T12:21:42.523Z","updated_at":"2025-02-27T02:30:27.296Z","avatar_url":"https://github.com/capaj.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# batched-promise-all\n\n:flight_departure: zero deps utility for keeping your memory footprint manageable with varying datasets\n\n## Get started\n\n```\nyarn add batched-promise-all\nnpm i batched-promise-all\n```\n\n### Usage\n\n```ts\nimport { batchedPromiseAll } from 'batched-promise-all'\n\nconst array = ['a', 'b', 'c', 'd', 'e', 'f', 'g']\n\nconst r = await batchedPromiseAll(\n  // this will be 4x slower and consume 1/4 of memory compared to the Promise.all(array.map(...))\n  array,\n  async (item, index) =\u003e {\n    // your iterator callback-same as you would use for .map method on your array\n    await delay()\n    return [item, index]\n  },\n  2 // batch size\n)\n```\n\n### Why would you use this?\n\nWhen dealing with big data sets awaiting thousands of promises at once can easily make your node.js process run out of memory-especially if you're running on small instances. Using batched-promise-all you can avoid this easily with a single import.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapaj%2Fbatched-promise-all","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcapaj%2Fbatched-promise-all","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapaj%2Fbatched-promise-all/lists"}