lru

JSON →
library 3.1.0 ·javascript
verified Jun 7, 2026

A minimal O(1) LRU cache for Node.js supporting set, get, peek, remove, clear, and eviction events. Version 3.1.0 is stable and suitable for small caches. It uses a linked list and hash map for O(1) operations. Differentiators: simple API, evict event, optional maxAge for TTL, and CommonJS support. No TypeScript types, no ESM. Suitable for Node >= 0.4.0.