@cache-utils/adapter-memory
v0.0.2
Published
Zero-dependency in-memory CacheAdapter for @cache-utils/core.
Downloads
284
Maintainers
Readme
@cache-utils/adapter-memory
Zero-dependency in-memory CacheAdapter for @cache-utils/core.
This is the same adapter CacheManager uses by default when constructed
with no arguments — install this package directly if you want to reference
MemoryAdapter explicitly (e.g. to pass it around, or construct several
independent instances).
Install
npm install @cache-utils/adapter-memory @cache-utils/coreUsage
import { CacheManager } from "@cache-utils/core";
import { MemoryAdapter } from "@cache-utils/adapter-memory";
const cache = new CacheManager(new MemoryAdapter());
await cache.set("key", "value", 60);
await cache.get("key");Good for tests, local dev, and single-process apps that don't need a shared
cache across instances. For multi-process or persistent caching, use
@cache-utils/adapter-redis instead.
License
MIT
