think-redis
Install
npm install think-redis
How to Use
default options
You can find all the config options at https://github.com/luin/ioredis/blob/master/lib/redis.js
const defaultConfig = port: 6379 // Redis port host: '127.0.0.1' // Redis host password: '';
usage
; let redisInst = config; // set keylet s1 = await redisInst; // never expirelet s2 = await redisInst; // millisecondslet s3 = await redisInst; //secondslet s4 = await redisInst; //milliseconds // get key's valuelet g1 = await redisInst; // delete keylet d1 = await redisInst; // add event listener, supported events see at https://github.com/luin/ioredisredisInst; // increase 1, if key not exist, set key's value eq 0 and then increase 1await redisInst; // decrease 1, if key not exist, set key's value eq 0 then decrease 1await redisInst;