{"id":16684535,"url":"https://github.com/saoudrizwan/p-limit","last_synced_at":"2026-04-16T09:02:21.675Z","repository":{"id":82148766,"uuid":"207060338","full_name":"saoudrizwan/p-limit","owner":"saoudrizwan","description":null,"archived":false,"fork":false,"pushed_at":"2019-10-07T05:50:09.000Z","size":29,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-27T20:46:58.340Z","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/saoudrizwan.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":".github/funding.yml","license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/security.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"sindresorhus","open_collective":"sindresorhus","tidelift":"npm/p-limit","custom":"https://sindresorhus.com/donate"}},"created_at":"2019-09-08T04:13:55.000Z","updated_at":"2019-10-08T06:35:19.000Z","dependencies_parsed_at":"2023-03-01T02:30:48.032Z","dependency_job_id":null,"html_url":"https://github.com/saoudrizwan/p-limit","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/saoudrizwan/p-limit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saoudrizwan%2Fp-limit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saoudrizwan%2Fp-limit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saoudrizwan%2Fp-limit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saoudrizwan%2Fp-limit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saoudrizwan","download_url":"https://codeload.github.com/saoudrizwan/p-limit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saoudrizwan%2Fp-limit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31878831,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T07:36:03.521Z","status":"ssl_error","status_checked_at":"2026-04-16T07:35:53.576Z","response_time":69,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-12T14:44:12.406Z","updated_at":"2026-04-16T09:02:21.640Z","avatar_url":"https://github.com/saoudrizwan.png","language":"JavaScript","funding_links":["https://github.com/sponsors/sindresorhus","https://opencollective.com/sindresorhus","https://tidelift.com/funding/github/npm/p-limit","https://sindresorhus.com/donate","https://tidelift.com/subscription/pkg/npm-p-limit?utm_source=npm-p-limit\u0026utm_medium=referral\u0026utm_campaign=readme"],"categories":[],"sub_categories":[],"readme":"# p-limit [![Build Status](https://travis-ci.org/sindresorhus/p-limit.svg?branch=master)](https://travis-ci.org/sindresorhus/p-limit)\n\n\u003e Run multiple promise-returning \u0026 async functions with limited concurrency\n\n\n## Install\n\n```\n$ npm install p-limit\n```\n\n\n## Usage\n\n```js\nconst pLimit = require('p-limit');\n\nconst limit = pLimit(1);\n\nconst input = [\n\tlimit(() =\u003e fetchSomething('foo')),\n\tlimit(() =\u003e fetchSomething('bar')),\n\tlimit(() =\u003e doSomething())\n];\n\n(async () =\u003e {\n\t// Only one promise is run at once\n\tconst result = await Promise.all(input);\n\tconsole.log(result);\n})();\n```\n\n\n## API\n\n### pLimit(concurrency)\n\nReturns a `limit` function.\n\n#### concurrency\n\nType: `number`\u003cbr\u003e\nMinimum: `1`\u003cbr\u003e\nDefault: `Infinity`\n\nConcurrency limit.\n\n### limit(fn, ...args)\n\nReturns the promise returned by calling `fn(...args)`.\n\n#### fn\n\nType: `Function`\n\nPromise-returning/async function.\n\n#### args\n\nAny arguments to pass through to `fn`.\n\nSupport for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a *lot* of functions.\n\n### limit.activeCount\n\nThe number of promises that are currently running.\n\n### limit.pendingCount\n\nThe number of promises that are waiting to run (i.e. their internal `fn` was not called yet).\n\n\n## FAQ\n\n### How is this different from the [`p-queue`](https://github.com/sindresorhus/p-queue) package?\n\nThis package is only about limiting the number of concurrent executions, while `p-queue` is a fully featured queue implementation with lots of different options, introspection, and ability to pause and clear the queue.\n\n\n## Related\n\n- [p-queue](https://github.com/sindresorhus/p-queue) - Promise queue with concurrency control\n- [p-throttle](https://github.com/sindresorhus/p-throttle) - Throttle promise-returning \u0026 async functions\n- [p-debounce](https://github.com/sindresorhus/p-debounce) - Debounce promise-returning \u0026 async functions\n- [p-all](https://github.com/sindresorhus/p-all) - Run promise-returning \u0026 async functions concurrently with optional limited concurrency\n- [More…](https://github.com/sindresorhus/promise-fun)\n\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\t\u003cb\u003e\n\t\t\u003ca href=\"https://tidelift.com/subscription/pkg/npm-p-limit?utm_source=npm-p-limit\u0026utm_medium=referral\u0026utm_campaign=readme\"\u003eGet professional support for this package with a Tidelift subscription\u003c/a\u003e\n\t\u003c/b\u003e\n\t\u003cbr\u003e\n\t\u003csub\u003e\n\t\tTidelift helps make open source sustainable for maintainers while giving companies\u003cbr\u003eassurances about security, maintenance, and licensing for their dependencies.\n\t\u003c/sub\u003e\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaoudrizwan%2Fp-limit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaoudrizwan%2Fp-limit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaoudrizwan%2Fp-limit/lists"}