Preparing for system design interviews?  Try bugzed.com →

weak-lru-cache

JSON →
library 1.2.2 ·javascript
verified Jun 7, 2026

A cache that combines LRU/LFU (LRFU) expiration with weak references, allowing garbage collection to reclaim unused cache entries. The cache retains strongly referenced data until it falls out of the LRU/LFU order, then uses weak references so the GC can free memory if needed. This package provides the WeakLRUCache class, which extends Map, and is suitable for Node.js (v14.10+) and Deno. Current version 1.2.2 is stable with a moderate release cadence. Compared to other LRU caches, weak-lru-cache's key differentiator is its use of weak references to avoid holding memory unnecessarily, making it ideal for large object caches where memory pressure is a concern.

total hits 11
actors 2 distinct systems
last hit 21d ago human
GPTBot
3
Amazonbot
3
Humans
5

top countries 🇺🇸 United States · 🇸🇬 Singapore · KE · 🇫🇷 France