
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
just-cache
Advanced tools
Simple in-memory cache manager and controller for Node JS with TTL and storage size limit
Simple in-memory cache manager and controller for Node JS with TTL and storage size limit.
const Just = require("just-cache");
const cache = new Just();
cache.set("message", "this text message");
cache.put("message", { foo: "bar" });
cache.set("message", true);
cache.get("message"); // { foo: "bar" };
Installation is easy with the npm command
$ npm install just-cache --save
Set or update cache value.
Add a new cache. If the cache key already exists, will not set the value.
Return the value stored.
Return the stored cache size. (value in bytes).
Return the stored formated size string.
Clean all stored cache.
Check if contains stored key cache.
Remove existing cache by key.
Get all stored keys.
Count all stored keys.
Set TTL on storage cache
const cache = new Just({
ttl: 10 // seconds
});
cache.set("message", "without me");
cache.set("another", "with me", 30 /* seconds */);
cache.get("message"); // 'with me'
// ... after 10 seconds:
cache.get("message"); // null
cache.has("message"); // false
cache.count(); // 1
cache.get("another"); // 'with me'
Set memory storage bytes limit. If new values exceed the memory limit, the first key in the queue will be removed during the sending of the new value.
const cache = new Just({
limit: 100 // in bytes
});
Check cache size:
cache.set("message", "this");
cache.size(); // 8
cache.sizeText(); // '8 bytes'
FAQs
Simple in-memory cache manager and controller for Node JS with TTL and storage size limit
We found that just-cache 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
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.