npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript.Learn more »

sequelize-transparent-cache-ioredis

2.0.2 • Public • Published

sequelize-transparent-cache-ioredis

ioredis adaptor for sequelize-transparent-cache.

Stores sequelize objects in redis using ioredis client.

Example usage

const Redis = require('ioredis')
const redis = new Redis()
 
const RedisAdaptor = require('sequelize-transparent-cache-ioredis')
const redisAdaptor = new RedisAdaptor({
  client: redis,
  namespace: 'model', // optional
  lifetime: 60 * 60   // optional
})
 

Constructor arguments

Param Type Required Description
client ioredis instance yes Configured ioredis instance
namespace string no Prefix for all keys
lifetime integer no Keys lifetime, seconds

Storing format

Each object stored as single JSON string. Namespace delimeter is ":".

Key Value
<namespace>:<modelName>:<objectId> {JSON string}

For more info see sequelize-transparent-cache

install

npm i sequelize-transparent-cache-ioredis

Downloadsweekly downloads

428

version

2.0.2

license

CC-BY-4.0

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability