Registry / security / express-throttle-redis

express-throttle-redis

JSON →
library0.0.4jsnpmunverified

Redis storage adapter for express-throttle rate-limiting middleware for Express. Current version 0.0.4, released as an early-stage package with no recent updates. Provides a Redis-backed store for throttling rate limits across distributed Node.js servers. Unlike default in-memory stores, it allows shared state across multiple processes or machines via Redis. However, it does not implement key expiration, so memory grows unbounded; requires manual Redis configuration with LRU eviction. Alternative: use express-rate-limit with rate-limit-redis, which has more active maintenance and built-in key expiry.

npm install express-throttle-redis
INSTALL
IMPORT
SIG · EXPRESS-THROTTLE-R
E
express-throttle-redis
securityjavascriptv0.0.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

RedisStore
const RedisStore = require('express-throttle-redis');
import RedisStore from 'express-throttle-redis';
CJS-only; no ESM or TypeScript types provided. Must use require.
throttle
const throttle = require('express-throttle');
const throttle = require('express-throttle-redis');
express-throttle-redis exports only the store, not the throttle middleware itself.
redisClient
const client = require('redis').createClient(); const store = new RedisStore(client);;
const store = new RedisStore();
Constructor requires a Redis client instance, not optional.

Sets up an Express app with Redis-backed rate limiting using express-throttle and express-throttle-redis.

const express = require('express'); const throttle = require('express-throttle'); const redis = require('redis'); const RedisStore = require('express-throttle-redis'); const app = express(); const client = redis.createClient({ url: process.env.REDIS_URL ?? 'redis://localhost:6379' }); app.post('/search', throttle({ burst: 10, rate: '5/s', store: new RedisStore(client) }), (req, res) => { res.json({ status: 'ok' }); }); app.listen(3000);
Debug
Known issues
gotchaNo key expiration: All Redis keys set by express-throttle-redis never expire, causing memory to grow unbounded. Requires Redis maxmemory-policy allkeys-lru to avoid crash.
fix
Configure Redis with maxmemory and maxmemory-policy allkeys-lru, or use a rate-limiting library with TTL support.
affects: >=0.0.1
deprecatedPackage is unmaintained since 0.0.4 (2017). No ESM, TypeScript types, or updates for modern Node.js or Express.
fix
Switch to express-rate-limit with rate-limit-redis for active maintenance and features.
affects: >=0.0.4
breakingConstructor expects a Redis client from the redis package v2.x, not v3+ or ioredis. Using ioredis or redis v4 will break.
fix
Use redis@2.x, or adapt by wrapping ioredis in a compatible interface.
affects: >=0.0.1
Errors
Common errors & fixes
TypeError: RedisStore is not a constructor
Using ES6 import syntax which does not work with CJS default export.
fix
Use const RedisStore = require('express-throttle-redis');
Error: ReplyError: MOVED ...
Using Redis cluster without proper client setup.
fix
Ensure redis client is configured for cluster mode (e.g., require('redis').createCluster).
Unhandled rejection: Error: The property 'store' must be an instance of a Store
Passing a plain object instead of a RedisStore instance.
fix
Pass new RedisStore(client) as the store option.
Upgrade
Version history
0.0.4latest on npm
Audit
Dependencies
express-throttlerequiredpeer dependency; express-throttle-redis is a store adapter for express-throttle
redisrequiredrequired to create a Redis client passed to the store constructor
Agent activity
35 hits · last 30 days
node
32
OpenAI (training)
1
Resources
express-throttle-redis — npm install express-throttle-redis · libregistry