tmp-cache

JSON →
library 1.1.0 ·javascript
verified Jun 7, 2026

A minimal least-recently-used (LRU) cache implementation in about 35 lines of code, extending the native Map class. At version 1.1.0 (latest), it supports configurable max size, per-item or global maxAge for expiration, and a stale option to return expired values before deletion. Released steadily since 2017, it has zero dependencies and ships TypeScript type declarations. Compared to heavier alternatives like lru-cache, tmp-cache prioritizes simplicity and small bundle size, making it suitable for lightweight caching in Node.js (>=6) or modern browsers.