New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

node-ts-cache-storage-ioredis

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-ts-cache-storage-ioredis

Redis storage module for node-ts-cache

  • 4.4.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
517
increased by13.88%
Maintainers
1
Weekly downloads
 
Created
Source

IoRedis storage module for node-ts-cache.

An IoRedis instance must be created and passed to the library. See https://github.com/luin/ioredis#connect-to-redis for available options.

npm i node-ts-cache
npm i node-ts-cache-storage-ioredis
npm i ioredis
npm i -D @types/ioredis
import { Cache, CacheContainer } from "node-ts-cache"
import { IoRedisStorage } from "node-ts-cache-storage-ioredis"
import IoRedis from "ioredis"

const ioRedisInstance = new IoRedis({
    port: 6379, // Redis port
    host: "127.0.0.1", // Redis host
    family: 4, // 4 (IPv4) or 6 (IPv6)
    password: "auth",
    db: 0
})
const userCache = new CacheContainer(new IoRedisStorage(ioRedisInstance))

class MyService {
    @Cache(userCache, { ttl: 60 })
    public async getUsers(): Promise<string[]> {
        return ["Max", "User"]
    }
}

Keywords

FAQs

Package last updated on 11 Oct 2021

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