A lightweight, in-memory Node.js cache library with LRU eviction and TTL support, written in TypeScript (types included). Current stable version is 1.1.0 (released 2021-10-14). It has zero dependencies, a simple synchronous API (get/set/del/has/keys), and an optional async 'provider' helper to reduce boilerplate for cache-aside patterns. Unlike more complex caching solutions (e.g., node-cache or lru-cache), it focuses on a minimal, intuitive interface with full TypeScript typings. Release cadence is low (a few updates per year).
npm install adequate-cacheNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic synchronous cache operations and the async provider pattern
Change 'const AdequateCache = require('adequate-cache')' to 'const { AdequateCache } = require('adequate-cache')' or use ESM import { AdequateCache } from 'adequate-cache'Do not use undefined as a value. Use null or another sentinel if needed.
Upgrade to >=0.4.0 for promise deduplication
Always use string keys to avoid unexpected coercion
Use const { AdequateCache } = require('adequate-cache') or import { AdequateCache } from 'adequate-cache'Run npm install adequate-cache or yarn add adequate-cache
Create the cache with new AdequateCache({ provider: yourAsyncFn })No dependency data recorded yet.