keyv-fs
v1.0.2
Published
file system storage adapter for keyv
Downloads
590
Maintainers
Readme
keyv-fs
Filesystem storage adapter for Keyv. Especially useful for browser cache.
Install
npm install keyv-fs
Usage
const Keyv = require('keyv');
const KeyvFs = require('keyv-fs');
const fsStore = new KeyvFs();
const keyv = new Keyv({ store: fsStore });
Api
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.
License
MIT.