lru-cache
A fast, comprehensive Least-Recently-Used (LRU) cache for JavaScript and Node.js.
Why consider lru-cache?
lru-cache is an open-source, high-efficiency Least Recently Used (LRU) memory cache module for JavaScript written by Isaac Z. Schlueter. lru-cache supports max item size limitations, automatic time-to-live (TTL) expiration, and memory disposal callbacks.
Learn lru-cache by building
Practical setup notes, real use cases, and copy-ready examples in one focused guide.
In this guide2 sections
Overview of lru-cache
lru-cache retains frequently requested data objects in process memory with LRU evictions.
Quickstart
npm install lru-cacheimport { LRUCache } from 'lru-cache';const cache = new LRUCache({ max: 500, ttl: 1000 * 60 * 5 });cache.set('invoice_102', { amount: 500 });lru-cache is licensed under the ISC License.
Related tools
More options with a similar category or technology profile.
diskus
Minimal, fast alternative to du -sh written in Rust using multi-threaded directory traversal.
peco
Simplistic interactive filtering tool for Unix pipelines, process lists, and file trees.
Dapr CLI
Command-line tool for managing Dapr distributed application runtime environments and sidecars.
Freeze
Generate beautiful image screenshots and SVGs of code snippets and terminal outputs.