1.0.2 • Published 6 years ago

keyv-fs v1.0.2

Weekly downloads
8
License
MIT
Repository
github
Last release
6 years ago

keyv-fs

NPM Version Build Status codecov License

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.