think-redis is a Redis wrapper for ThinkJS framework (current version 1.1.4) built on top of ioredis. It provides a simplified promise-based API for common Redis operations like set, get, delete, increase, and decrease. Configuration options mirror ioredis. No frequent releases; it is a thin wrapper providing a ThinkJS-friendly interface with support for expired keys in milliseconds or seconds and event-driven connection handling. Differentiates from raw ioredis by offering convenience methods (e.g., `delete`, `increase`, `decrease`) and a constructor that accepts a config object.
npm install think-redisNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates constructing a Redis client, setting/getting a key, incrementing a counter, and listening for the connect event.
Use redis.set(key, value, ttl) for milliseconds, or redis.set(key, value, 'EX', seconds) for seconds.
Use await or .then() on all redis calls.
Consider using ioredis directly or a more actively maintained wrapper.
Use `const Redis = require('think-redis').default;` or switch to ESM `import Redis from 'think-redis'`.Start Redis server or set correct host/port in config (e.g., REDIS_HOST env var).
Create an instance: `const redis = new Redis(config);` then call redis.get().