Express middleware that provides a shared Redis client connection (via the `redis` package) across all requests. Current stable version 2.0.1 uses `redis` ^2.6.2 (peer dependency). Release cadence is low/maintenance only. Key differentiator: simple, zero-config middleware that adds `req.db` for Redis access, with optional custom property name and support for all `redis.createClient` options. Unlike more complex caching or session middleware, it just exposes the raw Redis client per request.
npm install express-redisNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows middleware setup with default Redis connection, reading a key via req.db.get().
Specify a custom name like 'redisClient' as the fourth argument: app.use(require('express-redis')(6379, '127.0.0.1', {}, 'redisClient')) then use req.redisClient.Either stick with `redis@^2.6.2` as peer dep, or migrate to a middleware that supports `redis@4+` (e.g., implement your own using modern async/await).
Use req.db (or custom property name) for Redis access. The custom name string affects both `req` and `res`, but by default only `req.db` exists.
Use middleware correctly: app.use(require('express-redis')());Start Redis server (e.g., `redis-server`) or provide correct connection arguments: app.use(require('express-redis')(port, host));Install redis: npm install redis@^2.6.2