ai-redis-client
v0.0.4
Published
A redis client tools for nodejs and want to look for a girlfriend...
Downloads
6
Readme
ai-redis-client
A redis client tools for nodejs and want to look for a girlfriend...
Installation
$ npm i ai-redis-client
Usage
const redisClient = key => {
// https://www.npmjs.com/package/@blued-core/qconf
return createRedisClient({ key, option: qconf })()
// or
return createRedisClient({ master: ['127.0.0.1:6379'] }, key)()
}
async function getTest () {
const userRedis = redisClient('user')
const res = await userRedis.hgetall('u:113').catch(err => {
console.error(err, { tips: 'test -> hgetall error' })
})
console.log(res)
return res
}
Options
// options
interface Config {
key?: string
time?: number
option: any
}
interface Redis {
master: Array<string>
password?: string
db?: number
}