1.0.5 • Published 3 years ago

@jsonbourne.xyz/redis v1.0.5

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

ioredis wrapper with fallback callback function

simple wrapper for ioredis that uses a callback function to fallback to fetch data from slower data source

Installation

Install my-project with npm

  npm i @jsonbourne.xyz/redis

Usage

import Redis from '@jsonbourne.xyz/redis'

const redisURL = 'rediss://123456789'
const redis = new Redis(redisURL)

const data = redis.getOrFallback('key', async () => {
  // if redis key is empty fall back to slow data aggregation
  return slowDatabaseCall()
})

console.log(data)

//flush / delete specific key
redis.flush('key')
1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago