# cache-file

> Store and get files from cache

Latest version **0.1.7** (published 2014-03-31) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.7 |
| Published | 2014-03-31 |
| First published | 2014-03-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Kevin Martensson |
| Maintainers | wblanchette |
| Keywords | cache, store |

## Links

- npm: https://www.npmjs.com/package/cache-file
- Repository: https://github.com/collectivecognition/cache-file
- Issues: https://github.com/collectivecognition/cache-file/issues
- npm.io page: https://npm.io/package/cache-file

## Dependencies (3)

- [mkdirp](https://npm.io/package/mkdirp.md) ~0.3.5
- [rimraf](https://npm.io/package/rimraf.md) ~2.2.2
- [hash-file](https://npm.io/package/hash-file.md) ~0.1.0

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

- 0.1.7 (latest) — 2014-03-31
- 0.1.6 — 2014-03-31

## README

# cache-file [![Build Status](https://secure.travis-ci.org/kevva/cache-file.png?branch=master)](http://travis-ci.org/kevva/cache-file)

Store and get files from cache with Node.js.

## Getting started

Install with [npm](https://npmjs.org/package/cache-file): `npm install cache-file`

## Examples

```js
var cache = require('cache-file');

// store test.jpg inside a test folder in cache
cache.store('test.jpg');

// get test.jpg from cache and save it as test-restored.jpg
cache.get('test.jpg', 'test-restored.jpg');

// check if test.jpg exists in cache
cache.check('test.jpg');

// get the path to test.jpg in cache
cache.path('test.jpg');

// remove test.jpg from cache
cache.clean('test.jpg');
```

## API

### .store(src, dest)

Store a file inside cache. Use `dest` to specify a custom name.

### .get(src, dest)

Get a cached file and save it to a desired location.

### .check(src)

Check if a cached file exists.

### .path(src)

Get the path to a cached file.

### .clean(src)

Remove a file from cache.

## License

[MIT License](http://en.wikipedia.org/wiki/MIT_License) (c) [Kevin Mårtensson](http://kevinmartensson.com)

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