Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
mongoose-redis-caching
Advanced tools
A simple caching solution for Mongoose working with Redis.
Simple and efficient mongoose redis caching solution
A simple Mongoose Redis caching module.
npm i mongoose-redis-caching
OR
yarn add mongoose-redis-caching
Require in the module
const mongoose = require("mongoose");
const mongooseRedisCaching = require("mongoose-redis-caching");
Configure your mongoose caching instance
mongooseRedisCaching(mongoose);
Add your own Redis URL to your .env file. The default is set to your local redis instance.
Then use as below (with Caching & no compression):
const blogs = await Blog.find({ _user: req.user.id }).cache();
With time expiration (in seconds, default is 60 sec):
const blogs = await Blog.find({ _user: req.user.id }).cache(15);
Use as below (without Caching):
const blogs = await Blog.find({ _user: req.user.id });
MIT
FAQs
A simple caching solution for Mongoose working with Redis.
The npm package mongoose-redis-caching receives a total of 5 weekly downloads. As such, mongoose-redis-caching popularity was classified as not popular.
We found that mongoose-redis-caching demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.