A lightweight LRU cache implementation leveraging the native Map class for ordered iteration. Version 0.1.0 is stable with no recent updates. Differentiators: simple API, no dependencies, O(1) operations by exploiting Map's insertion order. Best for Node.js or browser projects needing a minimal LRU cache without additional features like TTL or serialization. Not recommended for high-concurrency or memory-sensitive environments.
npm install lru-map-cacheNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates creating an LRU cache with capacity 3, adding four items, and showing eviction of the least recently used key.
Always pass a positive integer to new LRUCache(capacity).
Migrate to 'lru-cache' package which offers TTL, events, and TypeScript support.
Use cache.has(key) before delete if you need to check existence.
Use import LRUCache from 'lru-map-cache' or const LRUCache = require('lru-map-cache').defaultAdd import LRUCache from 'lru-map-cache' at top of file.
No dependency data recorded yet.