KeyvCacheProxy (v0.2.3) is a JavaScript/TypeScript library that provides a transparent caching proxy for any object's method calls using Keyv as the underlying store. It automatically caches return values of all methods with configurable TTL support, handling nested objects via deep proxy. Released under active development with a focus on zero-configuration wrapping of API clients (Octokit, Notion, Slack). Key differentiators: automatic caching of all method calls without decorators, supports any Keyv-compatible storage backend (memory, Redis, MongoDB, etc.), cache hooks for observability, and async-by-default conversion. Requires Node >=18 and TypeScript ^5.9.3 as peer dependency.
npm install keyv-cache-proxyNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates wrapping an object with a 60-second TTL cache, showing first call execution and subsequent cache hit.
Update TypeScript to ^5.9.3 or later: npm install typescript@^5.9.3
Upgrade Node.js to version 18 or later.
Always use 'await' when calling cached methods.
Ensure arguments are JSON-serializable or implement custom key generation via the 'prefix' option.
Do not wrap objects with non-deterministic methods, or set TTL appropriately.
Install keyv: npm install keyv
Install the package: npm install keyv-cache-proxy
Use named import: import { KeyvCacheProxy } from 'keyv-cache-proxy'