项目作者: roneyrao

项目描述 :
Filesystem storage adapter for Keyv.
高级语言: JavaScript
项目地址: git://github.com/roneyrao/keyv-fs.git
创建时间: 2018-03-08T09:13:50Z
项目社区:https://github.com/roneyrao/keyv-fs

开源协议:MIT License

下载


keyv-fs

NPM Version
Build Status
codecov
License

Filesystem storage adapter for Keyv. Especially useful for browser cache.

Install

  1. npm install keyv-fs

Usage

  1. const Keyv = require('keyv');
  2. const KeyvFs = require('keyv-fs');
  3. const fsStore = new KeyvFs();
  4. const keyv = new Keyv({ store: fsStore });

Api

  1. 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.