@xroom.app/redis-wrapper
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

Wrapper over redis package

Installation

Run from command line

npm i @xroom.app/redis-wrapper

Usage example

const { getGeneralRedisMethods, getHashMapRedisMethods } = require('@xroom.app/redis-wrapper/wrappers')
const { getRedisClient } = require('@xroom.app/redis-wrapper')

const url = 'redis://127.0.0.1:6379'
const dbNumber = 0

const clientPromise = getRedisClient(url, dbNumber)

const generalMethods = getGeneralRedisMethods(clientPromise)

const hashMapMethods = getHashMapRedisMethods(clientPromise)

const runTask = (async () => {
  await hashMapMethods.hset('myMap', 'foo', 'bar')

  const keys = await generalMethods.keys('my')

  console.log(keys.includes('myMap'))
})

runTask()

/@xroom.app/redis-wrapper/

    Package Sidebar

    Install

    npm i @xroom.app/redis-wrapper

    Weekly Downloads

    0

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    11.3 kB

    Total Files

    12

    Last publish

    Collaborators

    • xroom.app