lru-cache
A strong pick. 2nd of 10 caching and Redis clients.
lru-cache is the standard in-process LRU cache for JavaScript. It has bounds by count, size and TTL, stale-while-revalidate fetching, no dependencies and built-in types. For a single-process memory cache it is the default pick today. It does not share data between processes, so a Redis client is still needed for a shared cache.
Best for: Node.js or browser code that needs a fast, bounded in-memory cache inside one process, with no extra dependencies.
Scores
Overall8.2
How strongly do we recommend it for a new project today?
Claude Opus 5.5: 8.0, likely 7.5 to 8.5
For an in-process cache it is the default choice: complete, fast, typed, dependency-free and trusted across the ecosystem. It does not do Redis or shared caching, so ioredis, node-redis or Keyv still cover that part of the category. Reliance on one maintainer and a weak Scorecard keep it from a 9.
- github.com/isaacs/node-lru-cache: Feature set and stable v11 line
- dependents repos: Most dependents in the category
- npm-compare.com/cache-manager,lru-cache,lrucache,memory-cache,node-cache,quick-lru: Comparison with in-memory cache peers
- peers node-cache commitsLastYear: Main in-memory peer node-cache has had no commits in a year
GPT-6.2 Sol: 8.3, likely 7.1 to 9.1
For a new single-process cache, lru-cache is a stronger choice than node-cache thanks to explicit size limits, async refresh, and current maintenance. Keyv offers a cache API backed by Redis, and node-redis provides direct access to Redis commands. Concentrated release activity, a recent compatibility regression, and below-median adoption growth temper the recommendation.
- isaacs.github.io/node-lru-cache: Documents bounded storage and async refresh.
- peers node-cache, npm versionsLastYear, medianDownloadsRatio: node-cache last published in 2020, while lru-cache still releases and grows below the median.
- docs.nestjs.com/data/caching: Shows Keyv-backed caching with a shared Redis store.
- github.com/redis/node-redis: Documents direct Redis command access.
- github.com/isaacs/node-lru-cache/issues/397: Records a compatibility regression during a minor upgrade.
Needed by many6.0
How many developers need a tool for this job?
Claude Opus 5.5: 6.0, likely 5.0 to 7.0
Many backend and tooling projects need an in-process memory cache, and it runs in Node and in browsers. It covers only the in-memory half of the category, not Redis or shared caching. That is a large group but not most developers.
- pistack.xyz/posts/2026-09-01-lru-cache-vs-node-cache-vs-quick-lru-nodejs-caching-comparison: Per-process scope; multi-instance setups need Redis
- github.com/isaacs/node-lru-cache: General-purpose LRU cache, not tied to one runtime
GPT-6.2 Sol: 5.9, likely 4.7 to 7.1
A bounded local cache is useful in servers, browsers, and developer tooling. Each process keeps a separate copy, so the fit narrows when replicas need shared state. Runtime surveys show a large potential audience, but how often those projects need an explicit local cache is uncertain.
- 2025.stateofjs.com/en-US/other-tools: Node.js and browsers lead reported runtime use.
- isaacs.github.io/node-lru-cache: Documents the local cache and its storage limits.
- raw.githubusercontent.com/isaacs/node-lru-cache/v11.5.3/package.json: Lists browser, React Native, and Node builds.
Helps a lot8.6
How well does it do the job for those who need it?
Claude Opus 5.5: 8.5, likely 7.5 to 9.0
It is the most complete in-memory LRU on npm: count, size and TTL bounds, dispose hooks, async fetch with deduplication and stale-while-revalidate, and diagnostics_channel metrics, all in TypeScript. Third-party benchmarks put it close to the fastest LRUs; a few micro-libraries are slightly faster at simple get and set. Its limits come from its design: it keeps data in one process only, and its TTL is loose.
- github.com/isaacs/node-lru-cache: Feature set, performance notes, TTL caveats
- raw.githubusercontent.com/isaacs/node-lru-cache/HEAD/CHANGELOG.md: 11.x adds observability and fixes fetch edge cases
- pistack.xyz/posts/2026-09-01-lru-cache-vs-node-cache-vs-quick-lru-nodejs-caching-comparison: Calls it the only one of three with real memory accounting; recommends it for production
- npm hasTypes: Ships its own types
GPT-6.2 Sol: 8.7, likely 7.6 to 9.5
Version 11.5.3 combines precise eviction limits, typed examples, per-entry expiry, and async refresh in a straightforward API. Expiry is lazy by default, so a TTL alone can leave a cache growing. An independent benchmark found good eviction throughput on Node and Bun, with smaller libraries ahead on some workloads.
- isaacs.github.io/node-lru-cache: Documents size, expiry, and refresh behavior.
- github.com/oven-sh/bun/issues/44579: Independent eviction benchmark tests v11.5.3 on Node and Bun.
- npm hasTypes: TypeScript declarations ship with the package.
Holds up over time7.4
Will it still be a good choice in two years?
Claude Opus 5.5: 7.5, likely 6.5 to 8.5
It is in active use and maintenance: 66 commits and 17 npm versions in the last year, the last in September 2026, with only 4 open issues. v11 has been stable since 2024 and only adds features in minor versions. The main risk is that one maintainer does most of the work; 18 pull requests are open and the Scorecard rates maintenance low.
- github commitsLastYear: 66 commits
- npm versionsLastYear: 17 versions; latest 11.5.3 on 2026-09-18
- github openPullRequests: 18 open PRs vs 25 merged
- issues.ecosyste.ms/hosts/GitHub/repositories/isaacs%2Fnode-lru-cache: About 30 days average time to close issues
GPT-6.2 Sol: 7.3, likely 6.0 to 8.5
The project made 66 commits and published 17 npm versions over the past year, with releases slowing to two patches since May. Recent release commits center on one maintainer, and GitHub Sponsors shows a way to fund the work. Users reported that 11.3.0 broke some jsdom and Vitest setups, and the maintainer addressed the underlying import issue within days. That response is encouraging, while concentrated release activity leaves the two-year outlook less certain.
- github commitsLastYear, npm versionsLastYear, npm latestPublishedAt: 66 commits and 17 npm versions, latest September 18.
- github.com/isaacs/node-lru-cache/commits: Recent release commits center on the project owner.
- github.com/sponsors/isaacs: The lead maintainer accepts sponsorship.
- github.com/isaacs/node-lru-cache/issues/397: Users reported an import regression and the maintainer responded within days.
Used widely8.3
How many use it, and is that growing?
Claude Opus 5.5: 9.0, likely 8.0 to 9.5
It has 1.2 million dependent repositories, the most in the category, ahead of Keyv. Its 3.2 billion downloads in four weeks are mostly transitive, through npm, glob and similar tools. The download ratio of about 3.1 is below the 4.1 median, so its share is stable to slightly falling. Even after these corrections, direct use runs to hundreds of thousands of projects.
- dependents repos: 1,198,118 repos, 6,362 packages
- npm downloadsLast4Weeks: 3.2B vs 1.03B a year ago, ratio about 3.1
- medianDownloadsRatio: Median 4.1, so it is below the median
- github stars: 5,920 stars
GPT-6.2 Sol: 7.5, likely 5.8 to 8.7
Ecosyste.ms found about 1.2 million dependent repositories and 6,362 dependent packages, the highest repository count in this group and slightly ahead of Keyv. Many installs come through other packages, and older versions still account for a large share, so direct adoption is hard to estimate. Four-week downloads grew 3.12× year over year, below the 4.1× catalog median and behind Keyv and ioredis, indicating a loss of relative ground.
- dependents repos, dependents packages, peers dependentRepos: Leads the supplied peers in tracked dependent repositories.
- npm downloadsLast4Weeks, npm downloadsSame4WeeksYearAgo, medianDownloadsRatio, peers: 3.12× growth trails the 4.1× catalog median.
- project note: Other packages account for many installs.
- npmjs.com/package/lru-cache?activeTab=versions: The legacy v10 release still records more weekly downloads than 11.5.3.
Vouched for8.1
Who stands behind it being good?
Claude Opus 5.5: 8.0, likely 7.0 to 9.0
Core tooling such as the npm CLI and glob runs it in production at huge scale. Independent comparisons recommend it as the production choice for in-memory caching, and other libraries benchmark themselves against it. There is no survey data for this kind of utility, and Hacker News and Bluesky barely discuss it.
- npm CLI and glob dependency trees: Used inside npm's own tooling
- pistack.xyz/posts/2026-09-01-lru-cache-vs-node-cache-vs-quick-lru-nodejs-caching-comparison: Independent write-up recommends it for production
- codspeed.io/belgattitude/httpx/branches/renovate%2Flru-cache-11.x: Used as the reference in third-party LRU benchmarks
- bluesky posts: Only 1 post; little discussion
GPT-6.2 Sol: 8.2, likely 7.0 to 9.1
Apollo Server uses it for its default in-memory cache, and jsdom directly declares 11.5.3 as its minimum version. An independent benchmark adds current performance evidence for a specific eviction workload. The range reflects limited evidence on developer satisfaction and performance across real application workloads.
- apollographql.com/docs/apollo-server/performance/cache-backends: Apollo Server uses an lru-cache wrapper by default.
- github.com/apollographql/apollo-utils/blob/main/packages/keyValueCache/CHANGELOG.md: Apollo's cache wrapper moved to v11.
- raw.githubusercontent.com/jsdom/jsdom/main/package.json: jsdom directly depends on lru-cache ^11.5.3.
- github.com/oven-sh/bun/issues/44579: An independent benchmark includes the current stable release.
Safe7.9
How safe is it to depend on?
Claude Opus 5.5: 8.0, likely 7.0 to 9.0
It has zero runtime dependencies, no OSV advisories ever, and a permissive BlueOak-1.0.0 licence, so the attack surface is small. The Scorecard is only 4: there is no code review, token permissions and dependency pinning are weak, and one person publishes releases. Its huge transitive reach makes the publish account a high-value target.
- npm dependencies: 0 dependencies
- advisories total: 0 advisories
- scorecard score: 4/10; Code-Review 0, Token-Permissions 0, Pinned-Dependencies 0
- github license: BlueOak-1.0.0, permissive
GPT-6.2 Sol: 7.8, likely 6.5 to 8.9
Zero runtime dependencies, no recorded OSV advisories, and the permissive Blue Oak Model License 1.0.0 keep dependency risk low. OpenSSF Scorecard gives it 4 out of 10, with zeroes for code review, workflow token permissions, dependency pinning, and fuzzing. The release scripts invoke npm publish directly, and uncertainty about the publisher roster and release provenance widens the range.
- npm dependencies, advisories total, scorecard checks: Zero runtime dependencies and recorded advisories, with several weak repository checks.
- raw.githubusercontent.com/isaacs/node-lru-cache/v11.5.3/package.json: Shows the release scripts and declares the Blue Oak license.
- blueoakcouncil.org/license/1.0.0: Permissive terms allow commercial use.
Good
- Zero dependencies, written in TypeScript, with a minified export.
- Bounds by item count, by total size through sizeCalculation, and by TTL.
- fetchMethod deduplicates in-flight loads and supports stale-while-revalidate, which helps prevent cache stampedes.
- Battle-tested: npm's own tooling and over a million repositories depend on it.
Bad
- Memory only and per process: no persistence and no cache shared across instances.
- TTL is not strictly enforced; for a TTL-only cache the same author points to @isaacs/ttlcache.
- One maintainer does most of the releases, and the OpenSSF Scorecard is a low 4 (no code review, unpinned dependencies).
- Majors v7 to v10 came close together, with changes to exports and types that broke some upgrades.
The numbers
- npm downloads, 4 weeks
- 3.2B ×3.1 in a year
- GitHub stars
- 5.9k
- Commits, 12 months
- 66
- npm version
- 11.5.3 Sept 2026
- Versions, 12 months
- 17
- Advisories, 24 months
- 0 of 0 ever
- OpenSSF Scorecard
- 4.0 out of 10, Nov 2026
- Licence
- BlueOak-1.0.0
Many packages install it, so most downloads are not a direct choice.
Read on 21 November 2026 from GitHub (isaacs/node-lru-cache), npm (lru-cache), OSV and the OpenSSF Scorecard.
Caching and Redis clients
- 8.3node-redis
- 8.2lru-cache
- 7.3Upstash Redis
- 7.1Valkey GLIDE
- 7.0unstorage
- 6.9ioredis
- 6.5BentoCache
- 6.3Keyv
- 6.2cache-manager
- 3.2node-cache