
Security News
ESLint Adds Official Support for Linting HTML
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
cache-manager-redis-yet
Advanced tools
The cache-manager-redis-yet package is a Redis store for the cache-manager module, which allows you to use Redis as a caching layer in your Node.js applications. It provides functionalities for setting, getting, and managing cache entries in a Redis database.
Setting a Cache Value
This feature allows you to set a value in the Redis cache with a specified time-to-live (TTL). The code sample demonstrates how to set up the cache manager with the Redis store and set a cache value.
const cacheManager = require('cache-manager');
const redisStore = require('cache-manager-redis-yet');
const cache = cacheManager.caching({
store: redisStore,
host: 'localhost',
port: 6379,
ttl: 600
});
cache.set('foo', 'bar', { ttl: 10 }, (err) => {
if (err) throw err;
console.log('Value set');
});
Getting a Cache Value
This feature allows you to retrieve a value from the Redis cache. The code sample shows how to get a previously set cache value.
cache.get('foo', (err, result) => {
if (err) throw err;
console.log(result); // 'bar'
});
Deleting a Cache Value
This feature allows you to delete a value from the Redis cache. The code sample demonstrates how to delete a cache entry.
cache.del('foo', (err) => {
if (err) throw err;
console.log('Value deleted');
});
Wrapping a Function
This feature allows you to wrap a function so that its result is cached. The code sample demonstrates how to wrap a function that simulates a long-running operation.
cache.wrap('foo', (cb) => {
// Simulate a long-running operation
setTimeout(() => {
cb(null, 'bar');
}, 2000);
}, (err, result) => {
if (err) throw err;
console.log(result); // 'bar'
});
cache-manager-redis-store is another Redis store for the cache-manager module. It provides similar functionalities for setting, getting, and managing cache entries in a Redis database. Compared to cache-manager-redis-yet, it is more widely used and has more community support.
node-cache-manager is a multi-store cache manager that supports various stores, including Redis. It provides a more flexible and extensible caching solution compared to cache-manager-redis-yet, allowing you to use different caching backends.
redis is a low-level Redis client for Node.js. While it does not provide the high-level caching functionalities of cache-manager-redis-yet, it offers more control and flexibility for interacting with Redis directly.
Redis cache store for [cache-manager](https://github.com/jaredwray/cacheable/tree/main/packages/cache-manager.
pnpm install cache-manager-redis-yet
Licensed under the MIT license.
Fork from https://github.com/dabroek/node-cache-manager-redis-store
FAQs
Redis store for node-cache-manager updated
The npm package cache-manager-redis-yet receives a total of 142,309 weekly downloads. As such, cache-manager-redis-yet popularity was classified as popular.
We found that cache-manager-redis-yet demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
Security News
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.