Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jpwilliams/rimiter
Simple in-memory rate limiter with banning
https://github.com/jpwilliams/rimiter
abuse ddos in-memory limit limiter memory rate rate-limiting spam
Last synced: 22 days ago
JSON representation
Simple in-memory rate limiter with banning
- Host: GitHub
- URL: https://github.com/jpwilliams/rimiter
- Owner: jpwilliams
- License: mit
- Created: 2017-04-03T12:53:54.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-04-03T16:24:58.000Z (over 7 years ago)
- Last Synced: 2024-10-06T03:52:56.002Z (about 1 month ago)
- Topics: abuse, ddos, in-memory, limit, limiter, memory, rate, rate-limiting, spam
- Language: JavaScript
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Rimiter
``` js
// 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