Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
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
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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.