A lightweight Redis wrapper around the ioredis module, designed for mocking key-value stores in tests or local scripts. Version 6.0.2 requires Node.js >=24.14.0. Ships TypeScript types. It requires a `delay` service and uses dependency injection for configuration, making it suitable for service-oriented applications. Compared to raw ioredis, it provides an abstraction layer for easier mocking and consistent service patterns.
npm install simple-redis-serviceNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initializes the Redis service with configuration from environment variables, sets and gets a value, then closes the connection.
Upgrade Node.js to v24.14.0 or later, or downgrade simple-redis-service to a version compatible with your Node.
Use default import: import initRedisService from 'simple-redis-service'
Set REDIS_PASSWORD_ENV_NAME in the services object, or migrate to v6 and pass password via ENV.
Provide a delay function: usually from common-services or a simple setTimeout wrapper.
Use console.log.bind(console) or a function with the same signature (message: string) => void.
import initRedisService from 'simple-redis-service' (not { initRedisService })npm install ioredis
Pass console.log.bind(console) or a function with signature (message: string) => void
Ensure Redis is running, or set REDIS_HOST/REDIS_PORT environment variables to the correct values.