@radzor/rate-limiter
In-memory rate limiting with token bucket and sliding window algorithms. Zero dependencies, automatic cleanup, and HTTP header generation.
Install
View source on GitHub →Inputs
| Name | Type | Default | Description |
|---|---|---|---|
| algorithm* | 'token-bucket' | 'sliding-window' | — | Rate limiting algorithm. Token bucket allows bursts; sliding window is stricter. |
| maxRequests* | number | — | Maximum number of requests allowed per window. |
| windowMs* | number | — | Time window in milliseconds. |
| keyPrefix | string | — | Optional prefix for rate limit keys (useful to separate different endpoints). |
Rate limiting algorithm. Token bucket allows bursts; sliding window is stricter.