
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Goldfish - the forgetful in-memory cache
// _, _,
// .' ( .-' /
// _/..._'. .' /
// .-'` ` '-./ _.'
// ( o) ;= <_
// '-.,\\__ __.-;`\ '.
// \) |`\ \) '. \
// \_/ jgs '-._\
// `
Goldfish({
populate: // fn(arg1, arg2, ..., cb)
expires: // (optional) Integer - miliseconds before a cache item is expired (default = Infinity)
remind: // (optional) Boolean - refresh expire time on fetch (default = false)
capacity: // (optional) Integer - max number of items to have in the cache (default = Infinity)
});
var redisClient = require('redis').createClient()
, Goldfish = require('goldfish')
, cache
;
cache = new Goldfish({
// the populate function will be run when a value does not yet exist in the cache
populate: function(key, cb) {
redisClient.get(key, cb);
},
capacity: 1000, // keep at max 1000 items in the cache
expires: 9001 // evict items that are older than 9001 ms
});
// get value from cache, because 'test' isn't populated, run the populate function
cache.get('test', function(err, result) {
if (err) return console.error(err);
return console.log(result);
});
// listen for any evictions
cache.on('evict', function(entry) {
console.log(entry.args); // Array - the args passed to populate resulting in this entry
console.log(evict.result); // Array - the results from populate
});
// clear the cache
cache.clear();
get#hit O(1)
get#miss O(1) + Populate()
clear O(n)
Complete disregard for the previous api. Don't blindly update.
Smaller, simpler api.
FAQs
Evented in-memory cache
The npm package goldfish receives a total of 2 weekly downloads. As such, goldfish popularity was classified as not popular.
We found that goldfish 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.