{"_id":"@cjser/p-limit__v6_2_0","name":"@cjser/p-limit__v6_2_0","dist-tags":{"latest":"6.2.0-cjser.2"},"versions":{"6.2.0-cjser.2":{"name":"@cjser/p-limit__v6_2_0","version":"6.2.0-cjser.2","description":"Run multiple promise-returning & async functions with limited concurrency","license":"MIT","repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","require":"./dist-cjser/index.cjs","default":"./index.js"},"sideEffects":false,"engines":{"node":">=18"},"scripts":{"test":"xo && ava && tsd"},"keywords":["promise","limit","limited","concurrency","throttle","throat","rate","batch","ratelimit","task","queue","async","await","promises","bluebird"],"dependencies":{"@cjser/yocto-queue":"1.2.2-cjser.2"},"devDependencies":{"ava":"^6.1.3","delay":"^6.0.0","in-range":"^3.0.0","random-int":"^3.0.0","time-span":"^5.1.0","tsd":"^0.31.1","xo":"^0.58.0"},"types":"./index.d.ts","main":"./dist-cjser/index.cjs","cjser":{"sourceVersion":"6.2.0","cjserVersion":2,"original":{"name":"p-limit","version":"6.2.0","exports":{"types":"./index.d.ts","default":"./index.js"},"repository":"sindresorhus/p-limit","dependencies":{"yocto-queue":"^1.1.1"},"files":["index.js","index.d.ts"],"scripts":{"test":"xo && ava && tsd"}}},"_id":"@cjser/p-limit__v6_2_0@6.2.0-cjser.2","gitHead":"a4bef54d7d22d3d9a6b84528457938d84cd65fe7","_nodeVersion":"20.14.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-RsO3sMHB6a4eA5bN64PQE7lr8B+PFNqOjWh+Z80XxIZSxmL5Y+2UBebV2ubTMKY1Fy9BV1qn+2hUSXEmd5lO+A==","shasum":"a29aadc7d36eff5751361e693a0ad555f06eea09","tarball":"https://registry.npmjs.org/@cjser/p-limit__v6_2_0/-/p-limit__v6_2_0-6.2.0-cjser.2.tgz","fileCount":6,"unpackedSize":15249,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICtbO3g2ZDAC5qdW8aGmi/Gw+DOag5CqkDjAVhmDz3ASAiAoGk/1lJvEL0tPqHn0Sp8FNF+akd2iWLTuatjbxxzN7A=="}]},"_npmUser":{"name":"nanahira","email":"nanahira@momobako.com"},"directories":{},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/p-limit__v6_2_0_6.2.0-cjser.2_1786899091668_0.39404634972628405"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-16T16:51:31.550Z","6.2.0-cjser.2":"2026-08-16T16:51:31.827Z","modified":"2026-08-16T16:51:32.016Z"},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"description":"Run multiple promise-returning & async functions with limited concurrency","keywords":["promise","limit","limited","concurrency","throttle","throat","rate","batch","ratelimit","task","queue","async","await","promises","bluebird"],"repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"license":"MIT","readme":"# p-limit\n\n> Run multiple promise-returning & async functions with limited concurrency\n\n*Works in Node.js and browsers.*\n\n## Install\n\n```sh\nnpm install p-limit\n```\n\n## Usage\n\n```js\nimport pLimit from 'p-limit';\n\nconst limit = pLimit(1);\n\nconst input = [\n\tlimit(() => fetchSomething('foo')),\n\tlimit(() => fetchSomething('bar')),\n\tlimit(() => doSomething())\n];\n\n// Only one promise is run at once\nconst result = await Promise.all(input);\nconsole.log(result);\n```\n\n## API\n\n### pLimit(concurrency) <sup>default export</sup>\n\nReturns a `limit` function.\n\n#### concurrency\n\nType: `number`\\\nMinimum: `1`\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### limit.clearQueue()\n\nDiscard pending promises that are waiting to run.\n\nThis might be useful if you want to teardown the queue at the end of your program's lifecycle or discard any function calls referencing an intermediary state of your app.\n\nNote: This does not cancel promises that are already running.\n\n### limit.concurrency\n\nGet or set the concurrency limit.\n\n### limitFunction(fn, options) <sup>named export</sup>\n\nReturns a function with limited concurrency.\n\nThe returned function manages its own concurrent executions, allowing you to call it multiple times without exceeding the specified concurrency limit.\n\nIdeal for scenarios where you need to control the number of simultaneous executions of a single function, rather than managing concurrency across multiple functions.\n\n```js\nimport {limitFunction} from 'p-limit';\n\nconst limitedFunction = limitFunction(async () => {\n\treturn doSomething();\n}, {concurrency: 1});\n\nconst input = Array.from({length: 10}, limitedFunction);\n\n// Only one promise is run at once.\nawait Promise.all(input);\n```\n\n#### fn\n\nType: `Function`\n\nPromise-returning/async function.\n\n#### options\n\nType: `object`\n\n#### concurrency\n\nType: `number`\\\nMinimum: `1`\n\nConcurrency limit.\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 the queue.\n\n## Related\n\n- [p-throttle](https://github.com/sindresorhus/p-throttle) - Throttle promise-returning & async functions\n- [p-debounce](https://github.com/sindresorhus/p-debounce) - Debounce promise-returning & async functions\n- [p-all](https://github.com/sindresorhus/p-all) - Run promise-returning & async functions concurrently with optional limited concurrency\n- [More…](https://github.com/sindresorhus/promise-fun)\n\n## cjser\n\nThis package is a CommonJS-compatible build generated by cjser for projects that still need `require()` support. The source version matches the original npm package version, with a cjser prerelease suffix for this generated build.\nOriginal repository: https://github.com/sindresorhus/p-limit\n","readmeFilename":"readme.md","_rev":"1-a919480b93b27cd90d031a2520b8d1a6"}