QuickLRU (TypeScript)

JSON →
library 1.0.0 ·javascript
verified Jun 7, 2026

A simple Least Recently Used (LRU) cache implementation in TypeScript. Version 1.0.0 wraps sindresorhus/quick-lru with TypeScript declarations. It uses a Map internally for O(1) operations and supports keys of any type, including objects and symbols. Key features include configurable maxSize and maxAge (with per-item TTL), an onEviction callback for cleanup, and multiple iteration methods (keys, values, entriesAscending, entriesDescending). Compared to lru-cache or tiny-lru, quick-lru-ts focuses on simplicity and minimal API surface. The package is ESM-only, requires Node.js >=12, and is stable with no breaking changes expected. It is actively maintained as a TypeScript conversion of the original quick-lru.