flat-cache

JSON →
library 6.1.22 ·javascript
verified Jun 7, 2026

A simple key/value cache that persists data to files, backed by an in-memory cache (CacheableMemory). Version 6.1.22 is the current stable release. Part of the Cacheable ecosystem, it combines in-memory speed with file persistence, supporting TTL, LRU eviction, expiration intervals, and automatic save intervals. Replaces the v5 prune method with built-in eviction from CacheableMemory. Ships ESM and CommonJS with TypeScript typings. Notable changes in v6: removed global functions (use imports), replaced prune with ttl/lruSize, changed save() behavior (no longer needs prune option), and introduced new options like serialize/deserialize.