lru-cache-promise (v1.0.9) is a thin wrapper around Isaac Z. Schlueter's lru-cache that adds promise-based async value fetching via a getAsync method. It uses Bluebird for promises and ensures that only one fetch request per key is in flight at a time, deduplicating concurrent calls. The package is stable with no recent releases and minimal maintenance. It differs from other caching libraries by being extremely lightweight and focused solely on adding promise support to lru-cache, without additional features like TTL or statistics.
npm install lru-cache-promiseNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to use getAsync with a fetch function that returns a promise, including deduplication of concurrent requests.
Call the require result as a function: require('lru-cache-promise')()Use a library that returns native Promises or wrap the result in Promise.resolve() if needed.
Consider upgrading to a cache library that supports lru-cache v6+, e.g., lru-cache-fp or lru-cache-async.
Use .lastly() from Bluebird or convert with Promise.resolve(cache.getAsync(...)).
const cache = require('lru-cache-promise')();Ensure bluebird is installed: npm install bluebird
Pass a function that returns a value or a promise.