📅 You're Invited: Meet the Socket team at RSAC (April 28 – May 1).RSVP

@type-cacheable/redis-adapter

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@type-cacheable/redis-adapter

Adapter for using redis with type-cacheable

17.2.0
latest
Version published
Weekly downloads
3.8K
3.98%
Maintainers
0
Weekly downloads
 
Created

@type-cacheable/redis-adapter

npm downloads

TypeScript-based caching decorators to assist with caching (and clearing cache for) async methods. This package supports the redis client.

View full documentation

Usage

Installation

npm install --save @type-cacheable/core @type-cacheable/redis-adapter

Note: If you are using redis v3.x.x, use @type-cacheable/redis-adapter v10.x.x. If you are using redis v4.x.x, use @type-cacheable/redis-adapter v11.x.x+.

or

yarn add @type-cacheable/core @type-cacheable/redis-adapter

Using adapter

import Redis from 'redis';
import { useAdapter } from '@type-cacheable/redis-adapter';

const client = Redis.createClient();
const clientAdapter = useAdapter(client);

Then you can rely on the @Cacheable, @CacheUpdate, and @CacheClear decorators from @type-cacheable/core. See core documentation

FAQs

Package last updated on 19 Dec 2024

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