TiloBox
Back to directory
lru-cache project preview

lru-cache

A fast, comprehensive Least-Recently-Used (LRU) cache for JavaScript and Node.js.

LicenseISC
GitHub stars4.5k
Last commit1 weeks ago
Tags5 topics
Lru Cache ModuleLeast Recently Used MemoryDeveloper ToolsLru Cache JsTtl Expiration Cache
Overview

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.

Guided learning

Learn lru-cache by building

Practical setup notes, real use cases, and copy-ready examples in one focused guide.

1 min read 2 sections
In this guide2 sections

Overview of lru-cache

lru-cache retains frequently requested data objects in process memory with LRU evictions.

Quickstart

bash
1npm install lru-cache
javascript
1import { LRUCache } from 'lru-cache';
2const cache = new LRUCache({ max: 500, ttl: 1000 * 60 * 5 });
3cache.set('invoice_102', { amount: 500 });

lru-cache is licensed under the ISC License.

Related tools

More options with a similar category or technology profile.

lru-cache FAQs

lru-cache is listed as a Developer Tools tool on TiloBox. Review the overview, features, and official documentation on this page to decide whether it solves your specific workflow.

Start with the project's GitHub repository for supported installation and deployment instructions. Test the setup with representative data or a small project before rolling it out more widely.

lru-cache is listed under the ISC license. Read the complete license text and the project's notices before using, modifying, or distributing the software.

Production readiness depends on your requirements. Review maintenance activity, security practices, documentation, backup and upgrade procedures, and compatibility with your stack; then validate it in a non-production environment.

lru-cache is listed as an alternative to Memcached. Compare the core workflow, deployment model, integrations, and licensing against your must-have requirements before switching.