A NestJS module providing easy integration with Redis via the `redis` (node-redis) package. Current version 0.0.3 requires NestJS 11, Node.js 24, and npm 11. It supports synchronous and asynchronous module configuration, multiple named connections, injection via `@InjectRedis` decorator or custom token, and automatic cleanup on application shutdown. Key differentiator: bundles the `redis` driver, offers a typed `RedisClientType` injection, and enforces ESM-only usage. Active development.
npm install nestjs-simple-redis-clientNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Basic setup with RedisModule registration and injection of Redis client in a service.
Set type: 'module' in package.json and use import/export syntax. Ensure Node.js version >= 24.
Ensure async factory returns an object with url property. Use ConfigModule and ConfigService for environment variables.
Use distinct names like 'cache' and 'sessions'. The default token REDIS_CLIENT is reserved for the default connection.
Pin version to 0.0.3 and monitor for updates. Consider using semver tilde range ~0.0.3 in package.json.
Install redis explicitly: npm install redis. Then add import type { RedisClientType } from 'redis'.Switch to ESM: set type: 'module' in package.json and use import statements instead of require.
Use a standard URL like redis://username:password@host:port/dbindex. Example: redis://:pass@localhost:6379/0.