Expiring LRU cache for Node.js built on top of lru-cache. Version 2.1.0 adds support for Bunyan logging and configurable item expiry. Provides a simple key-value store with LRU eviction and TTL per item. Differentiators: integrates with Bunyan for trace-level logging, lightweight wrapper around lru-cache. No breaking changes reported. Low release cadence (last release 2015). Minimal dependencies.
npm install expiring-lru-cacheNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic usage: instantiate cache with size and expiry, set/get/delete items.
If per-key TTL needed, use another library (e.g., lru-cache built-in TTL).
Consider migrating to lru-cache@6+ which supports per-item ttl and better performance.
Ensure Bunyan is installed if you enable logging, or omit the log option.
Create a .d.ts file or use require() with @types/node.
Use const Cache = require('expiring-lru-cache');Use 'new Cache({size: 100, expiry: 300})'Run 'npm install lru-cache' alongside expiring-lru-cache