1.1.2 • Published 3 years ago

think-cache-file v1.1.2

Weekly downloads
216
License
ISC
Repository
github
Last release
3 years ago

think-cache-file

Build Status Coverage Status npm

Use file to cache data

Install

npm install think-cache-file

How to Usage

edit config file src/config/adapter.js, add options:

const fileCache = require('think-cache-file');
exports.cache = {
  type: 'file',
  common: {
    timeout: 24 * 60 * 60 * 1000, // millisecond
  },
  file: {
    handle: fileCache,
    cachePath: '/home/usr/data',  // absolute path is necessarily required
    pathDepth: 1,
    gcInterval: 24 * 60 * 60 * 1000 // gc
  }
}