
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
uniquecache
Advanced tools
cache that you found some unique value and make sure you don't tell anyone else in this process that it is unique while you save it.
cognitive overhead.. if you need to implement this kind of logic you have at least on async call. i wanted it to look exactly the same.
fetch(myUniqueObject,Date.now(),function(err,unique){
if(unique) console.log('yayayayaya!')
})
but its kinda weird that i have to pass time you know bro?
you may not know what time you are processing i certainly cannot assume that you are processing things related to now!
so to use it.. you know. you require the library
var uniquecache = require('uniquecache');
The function returns the fetch function curried with cache magic. This will only call your real fetch function when it really has to. You know.. the useful part.
var fetch = uniquecache(
['id'] // use these object key's values to build the unique key from each object passed to fetch
,function(obj,time,callback){
callback(false,true);
calls++;
}
,1 // check every milisecond for data older than a milisecond [defaults to 5 minutes]
,1 // only ever hold one item. like ever. [defaults to 10000]
);
Really curry!? thats kind an effed api bro. its spicy and stuff why can't this be a stream.
Well if you look at it in http://maxogden.github.io/flavors there are clearly things that go with curry and though node is not on the list i think we'll recover.
but im a library implementor i hate cognitive overhead what does it look like for me?
var fetch = uniquecache(['id'],function(obj,time,cb){
api.call(url+'/'+obj.id,function(err,data){
cb(err,data?false:true);
});
});
module.exports = function(obj,cb){
fetch(obj,Date.now(),cb);
}
oh thats not bad. thanks.
FAQs
cache that you found some unique value and make sure you don't tell anyone else in this process that it is unique while you save it.
We found that uniquecache 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
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.