Redis GCRA Rate Limiter

JSON →
library 0.7.0 ·javascript
verified Jun 7, 2026

An implementation of the Generic Cell Rate Algorithm (GCRA) for rate limiting using Redis. Version 0.7.0 is the latest stable release, updated as of early 2025. It supports both ioredis and node-redis clients, with TypeScript type definitions included. Key differentiators are its reliance on the efficient GCRA algorithm (no token bucket overhead) and minimal dependencies. The package provides three core methods: limit (attempt to consume tokens), peek (check availability without consumption), and reset (clear state for a key). It is actively maintained by Losant with a focus on correctness and performance.