High-performance caching library for Node.js and browser environments supporting LRU and LFU eviction policies with O(1) complexity for all operations. Version 2.0.3 requires Node >=18.18.2. Ships TypeScript definitions. Differentiates from other caches by supporting both LRU and LFU engines, custom hash tables via symbols, and a unified API with clearAll and toArray methods for LRU. Offers configurable maximum size. Actively maintained with regular releases.
npm install node-cache-engineNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows creating a cache instance, adding, getting, checking, removing, and iterating items.
Upgrade Node.js to >=18.18.2 or pin version to 1.x.
Always provide an explicit size option to avoid unbounded growth.
Use default hash table unless you have extreme performance needs >5M entries.
Ensure engine string is uppercase: 'LRU' or 'LFU'.
Use LRU if you need those methods, or implement your own iteration for LFU.
import { createCache } from 'node-cache-engine'Use engine: 'LRU' or engine: 'LFU' exactly.
Use LRU engine, or manually remove items by iterating keys.
Use import statement or dynamic import().
No dependency data recorded yet.