Filesystem storage adapter for Keyv.
Filesystem storage adapter for Keyv. Especially useful for browser cache.
npm install keyv-fs
const Keyv = require('keyv');
const KeyvFs = require('keyv-fs');
const fsStore = new KeyvFs();
const keyv = new Keyv({ store: fsStore });
new KeyvFs(fs, rootDir, clean)
fs: custom file system, such as memory-fs, if omited, local file system is implied.
rootDir: directory where cache folder is placed, process.cwd()
is by default. Cache folder is named with keyvs namespace.
clean: whether to clear the cache folder when startup, false by default.
MIT.