cachified-redis-json-adapter
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

cachified-redis-json-adapter

All Contributors

An adapter meant to be used with @epicweb-dev/cachified

Why

While working through my personal website, I settled on using redis-json as the caching mechanism for my third party API requests. @epicweb-dev/cachified originally shipped with an adapter for redis but not for redis-json. This adapter exists for that purpose.

Install

npm install cachified-redis-json-adapter

Usage

Meant to be used with @epicweb-dev/cachified

import {redisJsonCacheAdapter} from 'cachified-redis-json-adapter'

// create an instance of a redis client to pass to our adapter
// you will need to define this yourself.
let redisClient = createRedisClient()
const redisCache = redisJsonCacheAdapter(redisClient)

// usage with cachified
return cachified({
  key: `some-cache-key`,
  // use the cache we defined above
  cache: redisCache,
  getFreshValue: async () => {}, // some function to get fresh values
  // other cachified optoins
})

Contributors ✨

Thanks goes to these wonderful people

Taranveer (Taran) Bains
Taranveer (Taran) Bains

💻 ⚠️ 📖

(emoji key):

This project follows the all-contributors specification. Contributions of any kind welcome!

Readme

Keywords

Package Sidebar

Install

npm i cachified-redis-json-adapter

Weekly Downloads

241

Version

2.0.0

License

MIT

Unpacked Size

84 kB

Total Files

9

Last publish

Collaborators

  • tearingitup786