A lightweight abstraction layer for node-redis that simplifies caching with automatic key prefixing, TTL support, and cache purging. Current stable version is 1.0.1. This package wraps the popular redis client to provide a clean API for set, get, and purge operations without exposing raw redis commands. It uses a minimalistic design with no external dependencies beyond node-redis, ideal for applications needing a simple caching helper rather than a full-featured cache library.
npm install redis-cache-clientNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a redis client, initializes cache client with prefix, sets a value with TTL, retrieves it, then purges all prefixed keys.
Use a prefix like 'myprefix:' with a trailing colon.
Provide TTL as number of seconds (e.g., 360 for 6 minutes).
Wrap calls with a promise library if needed.
Ensure only JSON-serializable data is stored with set.
Start redis server with 'redis-server' or set REDIS_URL to a valid endpoint.
Install redis: npm install redis
Call CacheClient with an object containing a valid 'client' key.
Provide a callback function as the last argument.