rimiter

1.0.2 • Public • Published

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 limited
  • banned - ID that has just been banned
  • unbanned - ID that has just been unbanned

Package Sidebar

Install

npm i rimiter

Weekly Downloads

10

Version

1.0.2

License

MIT

Last publish

Collaborators

  • jpwilliams