GitShow/sindresorhus/quick-lru
sindresorhus

quick-lru

Simple “Least Recently Used” (LRU) cache

by sindresorhus
Star on GitHubForknpm

JavaScript

765 stars60 forks19 contributorsActive · 1mo agoSince 2017v7.3.0MIT

Meet the team

See all 19 on GitHub →
sindresorhus
sindresorhus47 contributions
BendingBender
BendingBender2 contributions
skeggse
skeggse2 contributions
javi11
javi112 contributions
silverwind
silverwind2 contributions
adityapatadia
adityapatadia1 contribution
achingbrain
achingbrain1 contribution
coreyfarrell
coreyfarrell1 contribution

Languages

View on GitHub →
JavaScript98.5%
TypeScript1.5%

Commit activity

Last 12 weeks · 1 commit

Full graph →

Community health

4 of 6 standards met

Community profile →
85
✓README✓License✓Contributing✓Code of Conduct○Issue Template○PR Template

Recent fixes

View closed PRs →
clicktodev
Convert to TypeScriptMergedPR

Replace and the hand-written with a single typed that is compiled to . Runtime behavior is unchanged; the JSDoc from now lives on the members it documents, so the emitted declarations keep the same docs. Iterator-returning members are typed , since is no longer assignable to the signatures they override. The constructor destructures via so the still fires on while stays required in the public signature. deliberately keeps so a falls back to . Tests move to unchanged apart from type annotations and on the cases that intentionally pass invalid input. ava runs them through , so no compile step is needed to test on Node 18. Swap for , which supports ESM — the reason coverage upload was commented out in CI — and bump ava, xo, and tsd. Add Node 22 to the CI matrix.

clicktodev · 1w ago
light885168-star
Fix misleading name of resize() eviction testMergedPR

Summary The test (added in #24) actually asserts the opposite of its name: it checks that is called when shrinks the cache (). Renamed it to to match what it verifies. No behavioral or assertion changes. Test plan [x] Read through test.js to confirm the assertions match the new name [ ] CI (xo && nyc ava && tsd) passes on this PR

light885168-star · 1mo ago
hiSandog
Add descending key and value iteratorsMergedPR

Summary add for newest-first key iteration add for newest-first value iteration update TypeScript declarations and README add tests for ordering and duplicate-key behavior Why The API already exposes , but consumers currently need to map over entries just to get newest-first keys or values. Adding these iterators makes the API more symmetric and convenient while keeping the implementation small. Notes implementation delegates to to preserve ordering semantics verified the new iterators locally with direct runtime checks I was not able to complete the full run in this environment because stalled before devDependencies finished installing

hiSandog · 4mo ago
Structured data for AI agents

Repository: sindresorhus/quick-lru. Description: Simple “Least Recently Used” (LRU) cache Stars: 765, Forks: 60. Primary language: JavaScript. Languages: JavaScript (98.5%), TypeScript (1.5%). License: MIT. Latest release: v7.3.0 (10mo ago). Open PRs: 0, open issues: 0. Last activity: 1mo ago. Community health: 85%. Top contributors: sindresorhus, BendingBender, skeggse, javi11, silverwind, adityapatadia, achingbrain, coreyfarrell, fabiospampinato, lukechilds and others.

·@ofershap

Replace github.com with gitshow.dev