Gathering detailed insights and metrics for plimit-lit
Gathering detailed insights and metrics for plimit-lit
Gathering detailed insights and metrics for plimit-lit
Gathering detailed insights and metrics for plimit-lit
This package is a helper to run multiple promise-returning & async functions with limited concurrency.
npm install plimit-lit
Typescript
Module System
Min. Node Version
Node Version
NPM Version
TypeScript (85.74%)
Shell (13.25%)
JavaScript (1.01%)
Total Downloads
60,497,363
Last Day
57,377
Last Week
1,012,199
Last Month
4,280,435
Last Year
35,522,438
MIT License
3 Stars
65 Commits
1 Forks
2 Watchers
1 Branches
2 Contributors
Updated on May 20, 2024
Minified
Minified + Gzipped
Latest Version
3.0.1
Package Id
plimit-lit@3.0.1
Unpacked Size
10.01 kB
Size
3.22 kB
File Count
6
NPM Version
10.5.0
Node Version
20.12.2
Published on
May 20, 2024
Cumulative downloads
Total Downloads
Last Day
-3.3%
57,377
Compared to previous day
Last Week
-5.5%
1,012,199
Compared to previous week
Last Month
10.6%
4,280,435
Compared to previous month
Last Year
110.8%
35,522,438
Compared to previous year
1
This package is a helper to run multiple promise-returning & async functions with limited concurrency.
1$ npm i plimit-lit 2# or 3$ yarn add plimit-lit
1import { pLimit } from 'plimit-lit'; 2 3const limit = pLimit(1); 4 5(async () => { 6 // NOTE: Only one promise is run at once 7 const result = await Promise.all([ 8 limit(() => fetchSomething('foo')), 9 limit(() => fetchSomething('bar')), 10 limit(() => doSomething()), 11 ]); 12 console.log(result); 13})();
limit = pLimit(concurrency)
Returns a limit
function to enqueue promise returning or async functions.
concurrency
Type: number
Number of the concurrency limit.
limit(fn, ...args)
Returns a promise returned from calling fn(...args)
.
fn
Type: Function
Promise-returning or async function.
args
Optional arguments fn
is being called with.
Note: Support 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.
limit.activeCount
Static method that returns the number of promises currently running.
limit.pendingCount
Static method that returns the number of promises currently waiting to be run
(i.e. their internal fn
was not called yet).
limit.clearQueue()
Clear the internal queue of promises. This discards pending promises that are waiting to be run.
Note: This does not cancel in-flight promises!
(1) Install dependencies
1$ npm i 2# or 3$ yarn
(2) Run initial validation
1$ ./Taskfile.sh validate
(3) Start developing. See ./Taskfile.sh
for more tasks to
help you develop.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 4
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no SAST tool detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
18 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More