ai-redis-client
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

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

Package Sidebar

Install

npm i ai-redis-client

Weekly Downloads

5

Version

0.0.4

License

MIT

Unpacked Size

8.64 kB

Total Files

8

Last publish

Collaborators

  • meizikeai
  • kiddy0309
  • erdongjun