A lightweight LRU cache implementation with a Map-like interface that supports non-string keys including objects. Version 2.0.0 is the current stable release. The package is tiny (~2KB gzipped) compared to alternatives like node-lru-cache (~10KB gzipped). It prioritizes minimal bundle size while providing essential cache features with strong TypeScript support. Releases are infrequent.
npm install lru-map-likeNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to create an LRU cache, add entries, retrieve them, and see eviction when exceeding limit.
new LRUMapLike(100)
if (cache.has(key)) { const val = cache.get(key); }Remove onDispose calls and prepare for options-based disposal.
npm install lru-map-like
import { LRUMapLike } from 'lru-map-like'No dependency data recorded yet.