A simple short-term caching module for Redis that stores and retrieves data by keys. At version 0.2.1, it provides basic set, get, and delete operations with TTL support. Differentiates from other Redis caching libraries by its minimalistic design and simplicity, but lacks advanced features like caching strategies or invalidation patterns. The library is relatively inactive with limited updates and community support, making it suitable only for very basic caching needs.
npm install redis-cacheNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic usage: create a Redis client, initialize the cache with a TTL of 60 seconds, then set, get, and delete a key.
Consider migrating to a maintained alternative like 'node-cache' or 'ioredis' with caching logic.
Ensure you handle Redis client connection and error events yourself.
Wrap calls in Promises or use a promisify utility.
If per-key TTL needed, use a different library.
Use const redisCache = require('redis-cache').default or switch to require().Start Redis server or check REDIS_URL environment variable.
Ensure redisCache is called with a valid Redis client: redisCache(redisClient, options).