NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm, #12 most downloaded on npm
A cache object that deletes the least-recently-used items.
Latest stable
11.5.3
Last release 2 months ago
18 Sep 2026
Ships fairly regularly
a new release about every 4 weeks
Some releases are documented
notes for 17 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
15 years old
164 releases · first in 2011
Drag across the ruler to compare, or tap a release to open it.
Add allowStaleOnFetchRejection option
allowStaleOnFetchRejection optionProvide both ESM and CommonJS exports
Nothing published for this version
Add maxEntrySize option to prevent caching items above a given calculated size.
Your coding agent can read these notes before it upgrades. Set up the MCP server →
maxEntrySize option to prevent caching items above a
given calculated size.Nothing published for this version
Nothing published for this version
Add forceRefresh option to trigger a call to the fetchMethod even if the item is found in cache, and not older than its ttl.
forceRefresh option to trigger a call to the
fetchMethod even if the item is found in cache, and not
older than its ttl.Nothing published for this version
Add fetchContext option to provide additional information to the fetchMethod
fetchContext option to provide additional information to
the fetchMethodmaxSize would cause bizarre behavior.Add 'noDeleteOnStaleGet' option, to suppress behavior where a get() of a stale item would remove it from the cache.
get() of a stale item would remove it from the cache.Nothing published for this version
Nothing published for this version
Nothing published for this version
Add noDeleteOnFetchRejection option, to suppress behavior where a failed fetch will delete a previous stale value.
noDeleteOnFetchRejection option, to suppress behavior
where a failed fetch will delete a previous stale value.Nothing published for this version
Better AbortController polyfill, supporting signal.addEventListener('abort') and signal.onabort.
signal.addEventListener('abort') and signal.onabort.unhandledRejection when the fetchMethod throws an error or
returns a rejected Promise.Nothing published for this version
Nothing published for this version
warnings sent to console.error if process.emitWarning unavailable
updateAgeOnHas optionconsole.error if process.emitWarning unavailableNothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
fetch: provide options and abort signal
Nothing published for this version
Add async cache.fetch() method, fetchMethod option
Nothing published for this version
Nothing published for this version
defend against mutation while iterating
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Add browser optimized webpack bundle, exposed as 'lru-cache/browser'
'lru-cache/browser'noUpdateTTL option for set()Nothing published for this version
Nothing published for this version
Nothing published for this version
delete() returns boolean indicating whether anything was deleted
disposeAfter()set() returns the cache objectdelete() returns boolean indicating whether anything was deletedNothing published for this version
Nothing published for this version
Nothing published for this version
- Add reason to dispose() calls.
Nothing published for this version
Nothing published for this version
Nothing published for this version
- Add ttlResolution option - Add ttlAutopurge option
ttlResolution optionttlAutopurge optionNothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
This library changed to a different algorithm and internal data structure in version 7, yielding significantly better performance, albeit with some su
This library changed to a different algorithm and internal data structure in version 7, yielding significantly better performance, albeit with some subtle changes as a result.
If you were relying on the internals of LRUCache in version 6 or before, it probably will not work in version 7 and above.
For the most part, the feature set has been maintained as much as possible.
However, some other cleanup and refactoring changes were made in v7 as well.
set(), get(), and has() functions take options objects
instead of positional booleans/integers for optional parameters.size can be set explicitly on set().cache.length was renamed to the more fitting cache.size.stale option -> allowStalemaxAge option -> ttllength option -> sizeCalculationlength property -> sizedel() method -> delete()prune() method -> purgeStale()reset() method -> clear()cache.load() and cache.dump() are incompatible
with previous versions.max and maxSize are now two separate options. (Previously, they were
a single max option, which would be based on either count or computed
size.)dispose option is now expected to have signature
(value, key, reason) rather than (key, value), reversing the order of
value and key.Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
One column per quarter.