lru files
A file cache inspired by lru-cache.
Least recently used files are deleted. It's helpful if your filesystem uses atime
.
Everything is written to files and nothing is kept in-memory.
Install
npm install lru-files
Usgae
var lrufiles = ;var cache =files: 100 // maximum number of filessize: "1 GB" // maximum total file sizeage: "1 Day" // maximum last file accesscheck: "1 Hour" // interval of checkspersist: "1 Hour" // keep access statistics in a file, save in regular intervals;// add a file to cache. you can submit a buffer...cache;// ... readable stream ...cache;// ... or objectcache;// get a file from cachecache;// get a readable stream to a cached file, straight...cache;// ... or via callbaclcache;// check if a file is cachedcache;// update a files access timecache;// remove a file from cachecache;// manually remove old filescache;// empty everythingcache;