
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.
class-with-resources
Advanced tools
A class that has resources specified on the webcomponents, stylesheets and scripts attributes. Loaded using the loadResources method.
Cacher is an NPM module that serves to cache a value received from a promise, it allows you to specify the lifespan of cached value (defaults to 2000ms), if the value is requested another time before the cache has 'died' the cached value will be returned.
When the Cacher is executed it first looks for a cached value using the arguments provided (same input => same output), if found, it returns the cache, if not found, it executes the async function and caches the value it resolves with and returns this value to the user.
Run npm install
Run npm test
The Cacher module gives you a class when imported, you can instantiate or extends this class to have the execute method, and optionally change the lifespan.
import Cacher from 'frntnd-cacher';
const cacher = new Cacher({
lifespan: 3000,
execute(...args) {
return new Promise(resolve => {
// some async stuff that returns with the value that should be cached.
resolve(data);
});
}
});
FAQs
A class that has resources specified on the webcomponents, stylesheets and scripts attributes. Loaded using the loadResources method.
The npm package class-with-resources receives a total of 23 weekly downloads. As such, class-with-resources popularity was classified as not popular.
We found that class-with-resources 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.