A minimal Least Recently Used (LRU) cache implementation for Node.js and browsers. This package (v0.0.3) provides a simple constructor that accepts a maximum cache size and offers methods like set, get, peek, del, has, length, reset, keys, and a max getter/setter. It uses Object.create fallback for IE8 compatibility. The API is inspired by node-lru-cache but with a smaller footprint. No recent releases; appears unmaintained since 2013.
npm install simple-lruNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates an LRU cache with max 3 items, sets three values, retrieves 'a', then adds a fourth which evicts the least recently used item 'b'.
Use a maintained alternative like lru-cache or modern-lru.
If TTL needed, use a different library or implement manually.
Check documentation: most recently used key is last in the array.
Call length() as a function: cache.length() instead of cache.length.
Use const SimpleLRU = require('simple-lru'); (CommonJS) or import SimpleLRU from 'simple-lru' (ESM).Use cache.length() (call parentheses).
Run npm install simple-lru and ensure correct require/import.
No dependency data recorded yet.