Simple in-memory key/value cache for Node.js with automatic timeout-based expiration. Version 0.0.5 is the current stable release. The library provides basic cache operations (set, get, remove, clean) and emits events on entry expiration. It differs from more complex caching solutions (e.g., node-cache, lru-cache) by its minimal API and lack of advanced features like LRU eviction or TTL per entry. It is lightweight but offers configurable global timeout, optional timeout renewal on access, and the ability to disable timeout entirely.
npm install mem-cacheNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic usage: create cache with 5-second timeout, set and get value, then confirm auto-expiration.
Set timeoutDisabled: false and ensure appropriate timeout values, or manually clean cache.
Consider using node-cache or lru-cache which are actively maintained.
Use 'keys' only for debugging; rely on 'length' after ensuring no expired items remain.
Run 'npm install mem-cache' and verify package.json.
Use 'require' and 'new Cache()' as shown in docs.
Use 'var cache = new Cache();'
No dependency data recorded yet.