Skip to main content

Installation

Install Cachemate using your package manager of choice:

npm install cachemate

Package Managers

pnpm add cachemate

System Requirements

  • Node.js: Version 18.0.0 or higher (or compatible Bun / Deno runtimes).
  • Redis / Valkey: Redis 6.0+ or Valkey 7.0+. Both standalone and clustered setups are supported.
  • PostgreSQL (Optional): PostgreSQL 12+ if using the real-time pg-listen invalidation listener.

Dependencies & Optional Modules

Cachemate is packaged with zero unnecessary bloat:

  • Core Dependencies:
    • redis (^4.7.0): Modern async Redis client.
    • lru-cache (^11.0.2): Bounded in-memory failover cache with byte-accurate size computation.
    • pg-listen (^1.7.0): Lightweight PostgreSQL LISTEN/NOTIFY event bus.

TypeScript Support

Cachemate is written from the ground up in modern TypeScript and ships with complete built-in type declarations (.d.ts and .d.cts). No separate @types/cachemate package is needed.

Ensure your tsconfig.json has moduleResolution set to node16, nodenext, or bundler:

tsconfig.json
{
"compilerOptions": {
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"strict": true
}
}