
Security News
npm Tooling Bug Incorrectly Marks One-Character Packages as Security Holders
npm confirmed a tooling bug incorrectly marked several one-character packages as security holders and said it was working on a rollback.
cluster-shared-cache
Advanced tools
const cache = new ClusterSharedCache(options);
Options:
maxSize (number): Maximum number of items in cache (default: 1000)ttl (number): Default TTL in milliseconds (default: 300000 = 5 minutes)checkPeriod (number): Cleanup interval in milliseconds (default: 60000 = 1 minute)set(key, value, ttl?)Store a value in the cache.
await cache.set('user:123', userData, 300000); // 5 minutes TTL
await cache.set('config', configData); // Uses default TTL
get(key)Retrieve a value from the cache.
const user = await cache.get('user:123');
if (user) {
console.log('Cache hit!', user);
} else {
console.log('Cache miss');
}
delete(key)Remove a specific key from the cache.
await cache.delete('user:123');
clear()Clear all items from the cache.
await cache.clear();
has(key)Check if a key exists in the local cache.
if (cache.has('user:123')) {
console.log('Key exists locally');
}
size()Get the number of items in the local cache.
console.log('Cache size:', cache.size());
keys(), values(), entries()Get arrays of keys, values, or entries from the local cache.
console.log('All keys:', cache.keys());
console.log('All values:', cache.values());
console.log('All entries:', cache.entries());
SET: Updates master cache and broadcasts to all workersGET: Checks local cache first, then queries master if neededDELETE: Removes from master and all workerscache.destroy() when shutting downEnsure the cache is initialized in the master process before forking workers.
Reduce maxSize or lower TTL values to limit memory consumption.
Check if TTL is too aggressive or if you're over-using the cache.
FAQs
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
npm confirmed a tooling bug incorrectly marked several one-character packages as security holders and said it was working on a rollback.

Research
/Security News
Newer packages in this compromise use native extensions and .pth loaders to execute JavaScript stealers in developer environments.

Research
Socket found 37 malicious PyPI wheels that abuse Python startup hooks to launch a Bun-powered credential stealer tied to Mini Shai-Hulud/Miasma.