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

2.0.2 • Public • Published

cachified-redis-adapter

All Contributors

An adapter meant to be used with @epic-web/cachified

Why

@epic-web/cachified originally contained all adapters as a part of the same package. However, this can cause an issue when an adapter is updated and it becomes a breaking change release for the entire @epic-web/cachified package. This new npm package helps avoid this for the redis adapter and moves the adapter to its own package.

Install

npm install cachified-redis-adapter

Usage

Meant to be used with @epicweb-dev/cachified

If working with JSON data, try using the redis-json cachified adapter, linked below: cachified-redis-json-adapter

// Create an instance of a redis client to pass to the adapter
// You will need to define this yourself
import {createClient} from 'redis'
import {redisCacheAdapter} from 'cachified-redis-json-adapter'

const redis = createClient({
  /* ...opts */
})
const cache = redisCacheAdapter(redis)

await cachified({
  cache,
  key: 'user-1',
  getFreshValue() {
    return 'user@example.org'
  },
  /* ...opts */
})

Contributors

Taranveer (Taran) Bains
Taranveer (Taran) Bains

💻 ⚠️ 📖
Manjot Virdi
Manjot Virdi

💻 ⚠️ 📖

Readme

Keywords

Package Sidebar

Install

npm i cachified-redis-adapter

Weekly Downloads

142

Version

2.0.2

License

ISC

Unpacked Size

82.4 kB

Total Files

9

Last publish

Collaborators

  • tearingitup786
  • manjotvirdi