A Redis plugin for cache-service and a standalone Redis wrapper for Node.js (v2.0.2). Provides features like background refresh, automatic serialization/deserialization of objects, flexible Redis connection configuration (via env var, URL, or explicit params), and built-in logging with verbose flag. Compared to vanilla node_redis, it offers a more logical API (e.g., mset() accepts an object and supports per-key expiration). Compatible with cache-service and superagent-cache, and includes redis mock support for testing. The library is stable but in maintenance mode; no recent updates.
npm install cache-service-redisNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Instantiates cache-service-redis with a Redis URL, sets a serialized object with 60s TTL, then retrieves it.
Use { redisData: { port: 6379, hostname: 'localhost', auth: 'pass' } } instead of a single string.Use `redisUrl` with a full connection string or `redisData` object.
Set `backgroundRefreshInterval` < `backgroundRefreshMinTtl` (defaults: 60000 < 70000).
Set verbose on cache-service instance instead.
Use `const CacheServiceRedis = require('cache-service-redis');`Ensure Redis is running and check connection parameters (host, port, auth).
Verify import: `const CacheServiceRedis = require('cache-service-redis');` and instantiate with `new CacheServiceRedis(...)`.