@jmrl23/redis-store
v2.3.4
Published
Redis store for cache-manager
Downloads
9
Maintainers
Readme
Cache Manager Redis Store
Redis store for Cache Manager
Sample usage
import { caching } from 'cache-manager';
import redisStore from '@jmrl23/redis-store';
async function main() {
const store = redisStore({
url: 'redis://',
prefix: 'Example',
});
const cache = await caching(store);
await cache.set('message', 'Hello, World!');
const message = await cache.get<string>('message');
console.log(message); // Hello, World!
await store.disconnect();
}
void main();
Options
| Key | Description | Type |
| ------ | ------------------------------- | ------- |
| prefix | Prefix for keys | string? |
| ttl | Time to Live, 0
is to disable | number? |