lru-cache-fs
Extends lru-cache to add file system support.
Install
npm install lru-cache-fs
Usage
Retrieve cache:
const Cache = const cache = max: 100 cacheName: "cache" // filename ref to be used;
By default it will use os specific paths, using env-paths.
Then retrieve/set items using:
cache // returns whatever was storedcache // sets new item and stores cache sync to fs
The fsDump()
method exposes an API that allows you to persist the current cache on your file system:
cache
All other methods from lru-cache should be available, e.g:
cache // retrieves dump of current cache memory
License
MIT © 2019 Ruy Adorno