Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sequelize-transparent-cache-ioredis

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sequelize-transparent-cache-ioredis

ioredis adaptor for sequelize-transparent-cache

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.9K
increased by0.46%
Maintainers
1
Weekly downloads
 
Created
Source

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
})

const sequelizeCache = require('sequelize-transparent-cache')
const {classMethods, instanceMethods} = sequelizeCache(redisAdaptor)

const Sequelize = require('sequelize')
const sequelize = new Sequelize('database', 'user', 'password', {
  host: 'localhost',
  port: 3306,
  define: {
    classMethods,
    instanceMethods
  }
})

Constructor arguments

ParamTypeRequiredDescription
clientioredis instanceyesConfigured ioredis instance
namespacestringnoPrefix for all keys
lifetimeintegernoKeys lifetime, seconds

Storing format

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

KeyValue
<namespace>:<modelName>:<objectId>{JSON string}

For more info see sequelize-transparent-cache

Keywords

FAQs

Package last updated on 10 Jun 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc