node-rate-limit
Ensure that a series of functions are called with a minimum interval between each invocation.
Installation
npm install rate-limit
Usage
Call rateLimit.createQueue(options)
to create a queue,
where the interval between function calls is specified in milliseconds by options.interval
.
Add a function to be called by calling queue.add(func)
.
For instance:
var rateLimit = ; { return ;} var startTime = ; { console;} var queue = rateLimit; queue;queue;queue; // Sample output:// 0// 105// 206