A hierarchical cache manager for Node.js that chains multiple cache layers (e.g., in-memory LRU, database, remote server) with automatic fallback and propagation. v4.0.2 is the current stable release, with infrequent updates. Key differentiator: supports arbitrary key types, optional multi-get/set, and a customizable not-found check. The library is ESM-only and requires Node >=10.
npm install layered-cacheNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates creating a three-layered cache with in-memory LRU, async DB layer, and remote fallback.
Migrate to ESM by using import statements or dynamic import().
Provide a custom isNotFound option to override the default behavior.
Use `import type { InterfaceLayer } from 'layered-cache'`.Replace require() with import or use dynamic import().
Use `import LCache from 'layered-cache'`.
Ensure every layer implements get() or mget().
No dependency data recorded yet.