0.1.0 • Published 9 years ago
kork v0.1.0
kork
A crude rate limiter for node. A work in progress. Very experimental. Not suitable for production (or anything really).
install
$ npm i korkwat?
- Checks a global
tson each request - If
ratehas not passed since last execution - makes current request wait forratems
usage
// require and set rate in ms
var kork = require('kork')(2500);
// use in express
app.use([path,] kork);
// use in pype stack
pype(null, [klocka, kork, getData, finalhandler])(req, res);old API
Keeping this for the records
kork.init(rate) // sets new ts and applys rate limit in ms
kork.reset() // sets/overwrites ts
kork.limit() // checks tstodos
- add tests
- probably needs some kind of global queue
licence
MIT
0.1.0
9 years ago