Simple asynchronous in-memory cache for deduplicating concurrent calls to async functions. v1.1.0, no dependencies. Key differentiator: caches promises, not just values, so concurrent calls for the same key share a single pending promise, preventing duplicate execution. Supports optional TTL per entry. Minimal API: executeWithCache, delete, clear.
npm install asynchronous-cacheNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a cache instance and demonstrates deduplication of concurrent async calls using executeWithCache.
Use destructured require: const { Cache } = require('asynchronous-cache')Pass the async function reference: cache.executeWithCache('key', myFn), not cache.executeWithCache('key', myFn())Normalize keys to lowercase or a consistent format before calling executeWithCache.
Use named import: import { Cache } from 'asynchronous-cache'Pass the async function without invoking it: cache.executeWithCache('key', asyncFn)Run `npm install asynchronous-cache` and use correct import path 'asynchronous-cache'.
Use const { Cache } = require('asynchronous-cache')No dependency data recorded yet.