
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@endo/cache-map
Advanced tools
This @endo/cache-map package creates bounded-size caches having
WeakMap-compatible has/get/set/delete methods.
Key validity, comparison, and referential strength are controlled by a makeMap
option, which defaults to WeakMap but can be set to any producer of objects
with those methods (e.g., using Map allows for arbitrary keys which will be
strongly held).
Cache eviction policy is not currently configurable, but strives for a hit ratio
at least as good as
LRU (e.g., it
might be CLOCK
or SIEVE).
import { makeCacheMapKit } from '@endo/cache-map';
const { cache: weakCache, getMetrics } = makeCacheMapKit(2);
const entries = [
{ key: Symbol('key 1'), value: Symbol('value 1') },
{ key: Symbol('key 2'), value: Symbol('value 2') },
{ key: Symbol('key 3'), value: Symbol('value 3') },
];
for (const { key, value } of entries) weakCache.set(key, value);
assert(!weakCache.has(entries[0].key));
assert(weakCache.has(entries[1].key));
assert(weakCache.get(entries[2].key) === entries[2].value);
weakCache.delete(entries[2].key);
weakCache.set(entries[1].key, entries[0]);
assert(!weakCache.has(entries[0].key));
assert(!weakCache.has(entries[2].key));
assert(weakCache.get(entries[1].key) === entries[0]);
assert.throws(() => weakCache.set('unweakable key', {}));
import { makeCacheMapKit } from '@endo/cache-map';
const { cache, getMetrics } = makeCacheMapKit(100, { makeMap: Map });
cache.set('unweakable key', 'ok');
assert(cache.get('unweakable key') === 'ok');
FAQs
bounded-size caches having WeakMap-compatible methods
The npm package @endo/cache-map receives a total of 116,525 weekly downloads. As such, @endo/cache-map popularity was classified as popular.
We found that @endo/cache-map demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.