Simple Redis caching library for Node.js with connection pooling via generic-pool. Version 1.6.1 is the latest stable release as of 2025. It provides a straightforward key-value cache backed by Redis with configurable options for Redis connection, pool settings, serialization, logging, and expiration. Features both sync and async APIs, semaphore-based locking for distributed concurrency, and built-in statistics. It supports Node >=4 and uses ES6 features. Release cadence is low; the package appears to be in maintenance mode with infrequent updates.
npm install simple-redis-cacheNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initializes a Redis cache with connection pooling, sets a value, retrieves it, and closes the connection.
Set defaultExpiration and defaultExpirationMode in options (not documented but present in source). Review source or use an alternative library if per-key TTL is required.
Ensure you are using the documented async methods (get, set return promises). For sync methods, handle callbacks. Check source if unsure.
Consider migrating to a modern caching library like ioredis or redis v4 directly.
Pin your generic-pool version to match the one used by simple-redis-cache, or test thoroughly after updates.
Use const RedisCache = require('simple-redis-cache') instead of import.Ensure Redis is running and options.redisOptions.host/port are correct.
Create an instance: const cache = new RedisCache(); then call cache.set()