Extends lru-cache with file system persistence. Current stable version: 2.0.1. Low release cadence (last update 2019). Key differentiator: adds fsDump() and automatic sync to disk using env-paths for os-specific paths, while maintaining full lru-cache API. Alternative to manual JSON serialization.
npm install lru-cache-fsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a file-backed LRU cache, sets and gets a value, then persists cache to disk.
Use require() instead of import.
Always provide descriptive cacheName option.
Consider forking or using alternative with ongoing support.
Replace 'import Cache from "lru-cache-fs"' with 'const Cache = require("lru-cache-fs")'.Run with appropriate permissions or set NODE_ENV to override paths.