An async cache for Node.js (v3.2.0) that provides a lookup function per key with callback and promise support. Released under the ExpressenAB organization. Differentiates from similar libraries like async-cache by not caching errors, always calling the callback asynchronously, and allowing per-key TTL via additional arguments to the resolve function. Uses lru-cache by default but supports any compatible cache interface. Stable maintenance mode; low release cadence.
npm install exp-asynccacheNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates callback and promise usage of cache.lookup, including per-key TTL.
Ensure the cache key encompasses all variables that affect the result, e.g., concatenate name+location for a person lookup.
Handle errors in the lookup function by retrying or logging; do not rely on error caching.
Do not assume synchronous behavior; always treat callback as async.
Update lookup calls to use a function that receives resolve instead of passing resolve directly.
Install latest version: npm install exp-asynccache@3.2.0
Wrap resolve in a function: function(resolve) { ... resolve(...) }