rimiter
v1.0.2
Published
A simple in-memory rate limiter
Downloads
5
Maintainers
Readme
Rimiter
// get package
const Rimiter = require('rimiter')
// create a new rate limiter
const rimiter = new Rimiter()
// when an item is rate limited, ban them for 60 seconds
rimiter.on('limited', rimiter.ban)
// limited is whether 'user-1' is now rate limited
const limited = rimiter.limit('user-1')
Events
limited
- ID that has just been limitedbanned
- ID that has just been bannedunbanned
- ID that has just been unbanned