Fixed-window rate limiter for Node.js using a centralized Redis instance. Current stable version is 1.0.4 (released March 2022), with infrequent updates. It implements a fixed-window algorithm with millisecond precision, using only O(1) Redis operations for high performance (tested up to ~5.7M actions/minute locally). Unlike rolling-window limiters, it resets counters at window boundaries, which can allow bursts. Provides TypeScript types and promises-based API built on the 'redis' package v4+. Minimal dependencies (only @types/redis for TypeScript). Suitable for distributed systems (FaaS, microservices) requiring a centralized counter.
npm install async-redis-rate-limiterNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to import and use the fixed-window rate limiter with a Redis client.
Use a rolling-window limiter if burst behavior is unacceptable.
Use `redis.createClient({ url: 'redis://...' })` and call `.connect()`.Always await `redisClient.connect()` before rate-limiting.
Check that the Redis client is connected and that the FixedWindowRateLimit object has valid fields.
Upgrade to 'redis' v4+ and use createClient() and connect().