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.
A simple string map with a time to live. Similar to the maxAge setting in lru-cache except getting a key does not update it's time to live. Keys are not proactivly removed but only on calls to get or has.
Constructor, takes 2 arguments
Set the key to the specified value overwriting it if it already exists
Return the value with the specified key, if the key is not found then it will return undefined or in strict mode throw an error. The key will be deleted if it has expired.
Returns true if the key exists, false otherwise, if the key is expired it will be deleted and this method will return false.
Remove the key from the cache. If the key exists returns true, if it does it returns false or, in strict mode, throws an error.
var Cache = require('age-cache');
var cache = new Cache(1000); // one second
cache.set('foo', 'bar');
cache.get('foo'); // bar
cache.has('foo'); // true
cache.has('bar'); // false
setTimeout(function () {
cache.get('foo'); // undefined
cache.has('foo'); // false
}, 1001)
FAQs
string map with ttl
The npm package age-cache receives a total of 3 weekly downloads. As such, age-cache popularity was classified as not popular.
We found that age-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.
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.