# think-cache-file

> File cache Adapter for ThinkJS'S Cache

Latest version **1.1.2** (published 2021-07-02) · ISC license · 0 weekly downloads

## Install

```sh
npm install think-cache-file
pnpm add think-cache-file
yarn add think-cache-file
bun add think-cache-file
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2021-07-02 |
| First published | 2017-03-16 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 9.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | lushijie |
| Maintainers | lizheming, welefen, sijiecai, lushijie, berwin, bezos, toxicjohann, huangxiaolu |
| Keywords | think-cache-file |

## Links

- npm: https://www.npmjs.com/package/think-cache-file
- Repository: https://github.com/thinkjs/think-cache-file
- Homepage: https://github.com/thinkjs/think-cache-file#readme
- Issues: https://github.com/thinkjs/think-cache-file/issues
- npm.io page: https://npm.io/package/think-cache-file

## Dependencies (4)

- [think-gc](https://npm.io/package/think-gc.md) ^1.0.3
- [think-helper](https://npm.io/package/think-helper.md) ^1.1.3
- [think-debounce](https://npm.io/package/think-debounce.md) ^1.0.4
- [think-store-file](https://npm.io/package/think-store-file.md) ^1.0.12

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 1.1.2 (latest) — 2021-07-02
- 1.1.1 — 2019-12-23
- 1.1.0 — 2018-01-19
- 1.0.10 — 2017-09-11
- 1.0.9 — 2017-07-14
- 1.0.8 — 2017-04-01
- 1.0.7 — 2017-03-24
- 1.0.6 — 2017-03-19
- 1.0.5 — 2017-03-19
- 1.0.4 — 2017-03-18
- 1.0.3 — 2017-03-16

## README

# think-cache-file
[![Build Status](https://travis-ci.org/thinkjs/think-cache-file.svg?branch=master)](https://travis-ci.org/thinkjs/think-cache-file)
[![Coverage Status](https://coveralls.io/repos/github/thinkjs/think-cache-file/badge.svg?branch=master)](https://coveralls.io/github/thinkjs/think-cache-file?branch=master)
[![npm](https://img.shields.io/npm/v/think-cache-file.svg?style=flat-square)](https://www.npmjs.com/package/think-cache-file)

Use file to cache data

## Install

```
npm install think-cache-file
```


## How to Usage

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

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

---
_Source: https://npm.io/package/think-cache-file · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
