New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

goldfish

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

goldfish - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

2

index.js

@@ -129,2 +129,4 @@ /*!

if(!entry) return;
this._pullEntry(entry);

@@ -131,0 +133,0 @@ delete this._cache[key];

2

package.json

@@ -5,3 +5,3 @@ {

"description": "Evented in-memory cache",
"version": "0.0.2",
"version": "0.0.3",
"repository": {

@@ -8,0 +8,0 @@ "type": "git",

@@ -29,2 +29,43 @@ var goldfish = require('../');

});
});
describe('#expires', function() {
it('should expire a value after 10ms', function(done) {
var cache = goldfish.createGoldfish({
populate: function(key, cb) {
cb(null, key);
},
expires: 10,
cleanup: 1
});
cache.on('evict', function() {
done();
});
cache.get('test', function() {});
});
it('should evict multiple', function(done) {
var cache
, i
, count = 0
, num = 200
;
cache = goldfish.createGoldfish({
populate: function(key, cb) {
cb(null, key);
},
expires: 10,
cleanup: 1
});
cache.on('evict', function() {
if(++count === num) done();
});
for(i=0; i<num; ++i) {
cache.get('' + i, function() {});
}
})
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc