{"id":15354997,"url":"https://github.com/capaj/p-all-limit","last_synced_at":"2025-04-04T18:18:42.178Z","repository":{"id":66342161,"uuid":"584745500","full_name":"capaj/p-all-limit","owner":"capaj","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-03T22:35:00.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-10T03:27:46.725Z","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":null,"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":null,"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":"2023-01-03T12:10:04.000Z","updated_at":"2023-01-03T12:10:13.000Z","dependencies_parsed_at":"2023-02-24T23:00:17.902Z","dependency_job_id":null,"html_url":"https://github.com/capaj/p-all-limit","commit_stats":{"total_commits":6,"total_committers":1,"mean_commits":6.0,"dds":0.0,"last_synced_commit":"8c7ab01e4289af4f1c48249f8ba6581fdb9c18e2"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capaj%2Fp-all-limit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capaj%2Fp-all-limit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capaj%2Fp-all-limit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capaj%2Fp-all-limit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/capaj","download_url":"https://codeload.github.com/capaj/p-all-limit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247226191,"owners_count":20904467,"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:22:01.758Z","updated_at":"2025-04-04T18:18:42.159Z","avatar_url":"https://github.com/capaj.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## p-all-limit\n\n```ts\nimport { promiseAllLimit } from 'p-all-limit'\n\npromiseAllLimit(\n  [1, 2, 3, 4],\n  async (n) =\u003e {\n    console.log(n)\n    await sleep(1000)\n  },\n  2\n)\n```\n\noutputs:\n\n```sh\n1\n2\n# first batch finishes after 1000ms\n3\n4\n# second batch finishes\n```\n\n### Why is it needed\n\nFor when you are constrained by either memory or some other external constraint(eg. database connections) you must ensure that an array too big won't consume all available resources.\n\n### Why yet another package?\n\nThere is a lot of similar packages, for example:\n\n- https://www.npmjs.com/package/p-limit\n- https://www.npmjs.com/package/promise-parallel-limit\n- https://www.npmjs.com/package/promises-all-limit\n- https://www.npmjs.com/package/promise-limit\n\nbut none of them had the API I wished for, also typescript types were lacking for most of these. For example p-limit of them forces you to create a limit function and call it for each promise. This package lets you just call the\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapaj%2Fp-all-limit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcapaj%2Fp-all-limit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapaj%2Fp-all-limit/lists"}