ai-redis-client

A redis client tools for nodejs and want to look for a girlfriend...

Usage no npm install needed!

<script type="module">
  import aiRedisClient from 'https://cdn.skypack.dev/ai-redis-client';
</script>

README

ai-redis-client

npm version

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
}

License

MIT License