rate-limit-signal
v3.0.0
Published
limit rate by wating for a signal
Downloads
8
Readme
Rate Limit Signal
Limit rate by waiting a signal.
Installation
npm install rate-limit-sigal
Usage
const buildSignal = require('rate-limit-signal')
const signal = buildSignal({
interval: 1000, // milliseconds, default to 1000
count: 1, // how many items will pass per interval, default to 1
})
async function task() {
await signal()
// do something
}
task()
task()
...
License
MIT