
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
memoise is a memoisation/caching module for node.js. Results are cached in redis or memory, via a backing store. Redis is used if redis host port is provided in options.redis otherwise it fallback to in memory lru store.
create a cache with max 10000 items(only for lru) and a TTL of 300 seconds
const Memoise = require('memoise')
const memoiser = new Memoise({ max: 10000, maxAge: 300 })
Then wrap your original async function like this
const cached = memoiser.wrap(original)
Now call the wrapper as you would call the original function
await cached(arg1, arg2,...argn)
Creates a new Memoiser and returns it
Wraps a given function and returns a cached version of it. Functions to be wrapped must be async function and not object methods. Sometimes, you may want to use a different value of this inside the caller function.
The arguments are used to create the key. Subsequently, when the wrapped function is called with the same n arguments, it would lookup the key in LRU, and if found, call the callback with the associated data. It is expected that the callback will never modified the returned data, as any modifications of the original will change the object in cache.
The debug interface can be used to see stats and cache efficiency.
The library solve thundering heard problem by leaveraging redis as cache.
FAQs
Library for memoization/caching async functions
The npm package memoise receives a total of 1 weekly downloads. As such, memoise popularity was classified as not popular.
We found that memoise 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.