Skip to content

Latest commit

 

History

History
23 lines (16 loc) · 466 Bytes

README.md

File metadata and controls

23 lines (16 loc) · 466 Bytes

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