Cache Flow (v1.10.0) is a Node.js caching library with in-memory and Redis support, featuring automatic cache loading, fallback on Redis disconnection, and a TypeScript @Cacheable decorator. It simplifies caching by eliminating manual get-then-set patterns: you define a CacheLoader with a load method, and calling get() auto-populates and returns cached values. Compared to node-cache or ioredis manually, it offers integrated decorator support, dependency injection compatibility, and configurable serialization. Released under ISC license, last updated in 2022, with moderate release cadence.
npm install cache-flowNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows defining a CacheLoader subclass with automatic loading and caching of values.
Always declare load as async or return a Promise.
Add 'import "reflect-metadata";' at the very top of your main file.
Enable 'experimentalDecorators' in tsconfig.json.
Ensure in-memory fallback behavior is desired; no explicit fix needed, but be aware that data may be stale if Redis reconnects.
Ensure CacheLoader<K, V> is used as a base class in 'class MyCache extends CacheLoader<K, V>'.
Add 'import "reflect-metadata";' at the top of your entry file.
If not using Redis, ensure your configuration doesn't reference Redis; otherwise install ioredis.