think-cache-file

File cache Adapter for ThinkJS'S Cache

Usage no npm install needed!

<script type="module">
  import thinkCacheFile from 'https://cdn.skypack.dev/think-cache-file';
</script>

README

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
  }
}