A simple caching library for Node.js with both in-memory (MemoryCache) and Redis (RedisCache) backends. Version 0.1.9 supports features like default TTL, key prefixing, serialization toggle, atomic add, multi-get/set, and flush. It ships TypeScript types and provides a clean API similar to Yii2 caching. Release cadence is low; the package appears stable but not actively maintained. Compared to node-cache or node-cache-manager, it offers a unified interface for memory and Redis with minimal configuration.
npm install cache-listNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initializes MemoryCache, demonstrates set/get with TTL, exists, delete, multi operations, atomic add, and flush.
Replace if (cache.get('key')) with if (cache.get('key') !== false) or use cache.exists() first.Ensure keys are short alphanumeric strings to avoid hashing, or be aware of collision risk.
Use named imports: import { MemoryCache } from 'cache-list'.Iterate with for (const key of Object.keys(results)) if needed, and check results[key] !== false.
Run 'npm install redis' and ensure it is installed alongside cache-list.
Check TTL configuration, use cache.exists() before get(), and verify no flush or delete occurred.
Use correct named import: import { MemoryCache } from 'cache-list'; then instantiate with new.