Gathering detailed insights and metrics for throat
Gathering detailed insights and metrics for throat
Gathering detailed insights and metrics for throat
Gathering detailed insights and metrics for throat
npm install throat
Typescript
Module System
Node Version
NPM Version
JavaScript (95.52%)
TypeScript (4.48%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
484 Stars
63 Commits
40 Forks
3 Watchers
79 Branches
9 Contributors
Updated on Jul 07, 2025
Latest Version
6.0.2
Package Id
throat@6.0.2
Unpacked Size
8.93 kB
Size
3.43 kB
File Count
6
NPM Version
6.14.16
Node Version
12.22.12
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
8
Throttle the parallelism of an asynchronous, promise returning, function / functions. This has special utility when you set the concurrency to 1
. That way you get a mutually exclusive lock.
Professionally supported throat is now available
npm install throat
This returns a function that acts a bit like a lock (exactly as a lock if concurrency is 1).
Example, only 2 of the following functions will execute at any one time:
1const throat = require('throat')(2); 2 3const resA = throat(async () => { 4 /* async stuff... */ 5}); 6const resB = throat(async () => { 7 /* async stuff... */ 8}); 9const resC = throat(async () => { 10 /* async stuff... */ 11}); 12const resD = throat(async () => { 13 /* async stuff... */ 14}); 15const resE = throat(async () => { 16 /* async stuff... */ 17});
This returns a function that is an exact copy of worker
except that it will only execute up to concurrency
times in parallel before further requests are queued:
1const throat = require('throat'); 2 3const input = ['fileA.txt', 'fileB.txt', 'fileC.txt', 'fileD.txt']; 4const data = Promise.all( 5 input.map(throat(2, (fileName) => readFile(fileName))) 6);
Only 2 files will be read at a time, sometimes limiting parallelism in this way can improve scalability.
To report a security vulnerability, please use the Tidelift security contact. Tidelift will coordinate the fix and disclosure.
MIT
No vulnerabilities found.
Reason
security policy file detected
Details
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 4/22 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
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