Installations
npm install limit-it
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
12.16.3
NPM Version
6.14.4
Score
98.6
Supply Chain
100
Quality
76
Maintenance
100
Vulnerability
100
License
Releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
IonicaBizau
Download Statistics
Total Downloads
8,996,720
Last Day
6,691
Last Week
6,691
Last Month
114,644
Last Year
2,702,742
GitHub Statistics
2 Stars
43 Commits
4 Watching
1 Branches
1 Contributors
Bundle Size
1.60 kB
Minified
724.00 B
Minified + Gzipped
Package Meta Information
Latest Version
3.2.10
Package Id
limit-it@3.2.10
Size
4.16 kB
NPM Version
6.14.4
Node Version
12.16.3
Publised On
09 Aug 2020
Total Downloads
Cumulative downloads
Total Downloads
8,996,720
Last day
9.8%
6,691
Compared to previous day
Last week
-78.8%
6,691
Compared to previous week
Last month
-1.5%
114,644
Compared to previous month
Last year
114.1%
2,702,742
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
1
limit-it
Run in parallel as many functions you want, but not more than
functions at the time.
:cloud: Installation
1# Using npm 2npm install --save limit-it 3 4# Using yarn 5yarn add limit-it
:clipboard: Example
1// Dependencies 2var LimitIt = require("limit-it"); 3 4// Create the limiter 5var l = new LimitIt(10) 6 , c = 1 7 ; 8 9// Add 20 functions, running them in parallel but not more than 10 same time 10new Array(30).join("1").split("").forEach(function (_, i) { 11 l.add(function (count, callback) { 12 var random = Math.random() * 1000; 13 setTimeout(function() { 14 callback(random, i); 15 }, random); 16 }, [i], function (rand, i) { 17 console.log("> %s: Function %s done. Random number is: %s", ++c, i, rand); 18 }); 19});
:question: Get Help
There are few ways to get help:
- Please post questions on Stack Overflow. You can open issues with questions, as long you add a link to your Stack Overflow question.
- For bug reports and feature requests, open issues. :bug:
- For direct and quick help, you can use Codementor. :rocket:
:memo: Documentation
LimitIt(limit)
Creates a new instance of LimitIt
.
Params
- Number
limit
: The limit value representing the number of functions that are run in parallel at a moment of time.
Return
- LimitIt The
LimitIt
instance.
add(func, args, callback)
Adds a new function in the buffer.
Params
- Function
func
: The function to be run. - Array
args
: The arguments passed to the function. - Function
callback
: The callback function.
Return
- LimitIt The
LimitIt
instance.
exceeded()
Checks if the limit was exceeded.
Return
- Boolean
true
if the limit was exceeded, otherwisefalse
.
check()
Checks and runs the functions from the buffer.
Return
- LimitIt The
LimitIt
instance.
run(c)
Runs the function from the buffer element.
Params
- BuffElm
c
: The buffer element to run.
Return
- LimitIt The
LimitIt
instance.
:yum: How to contribute
Have an idea? Found a bug? See how to contribute.
:sparkling_heart: Support my projects
I open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously, this takes time. You can integrate and use these projects in your applications for free! You can even change the source code and redistribute (even resell it).
However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:
-
Starring and sharing the projects you like :rocket:
-
—I love books! I will remember you after years if you buy me one. :grin: :book:
-
—You can make one-time donations via PayPal. I'll probably buy a
coffeetea. :tea: -
—Set up a recurring monthly donation and you will get interesting news about what I'm doing (things that I don't share with everyone).
-
Bitcoin—You can send me bitcoins at this address (or scanning the code below):
1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6
Thanks! :heart:
:dizzy: Where is this library used?
If you are using this library in one of your projects, add it in this list. :sparkles:
exec-limiter
same-time-limit
:scroll: License
![Empty State](/_next/static/media/empty.e5fae2e5.png)
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/20 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 23 are checked with a SAST tool
Score
3
/10
Last Scanned on 2025-02-03
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 MoreOther packages similar to limit-it
spawn-to-readstream
Converts spawn to a ReadStream, buffers the error and emits it
push-it-to-the-limit
Delay function wrappers for common purposes. Throttle, debounce and ratelimit with promises
async-replace-with-limit
Run replace on a string and update it asynchronous
stream-meter
A stream meter that both counts the bytes piped through it, and can optionally abort on a max size. (e.g. limit a http request size)