kork
A crude rate limiter for node. A work in progress. Very experimental. Not suitable for production (or anything really).
install
$ npm i kork
wat?
- Checks a global
ts
on each request - If
rate
has not passed since last execution - makes current request wait forrate
ms
usage
// require and set rate in msvar kork = 2500;// use in expressapp;// use in pype stackreq res;
old API
Keeping this for the records
kork // sets new ts and applys rate limit in mskork // sets/overwrites tskork // checks ts
todos
- add tests
- probably needs some kind of global queue
licence
MIT