<commit_before># 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', { name: 'test' });

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

// clean all files inside the test folder inside cache
cache.clean('test.jpg', { name: 'test' });
```

## API

### .store(src, dest, opts)

Store a file inside cache. Use the `name` option to specify a specific folder 
inside cache.

### .get(src, dest, opts)

Get a cached file and save it to a desired location. Use the `name` option to 
look in a specific folder.

### .check(src, opts)

Check if a cached file exists.

### .clean(src, opts)

Clean cache. If the `name` option is specified it'll remove the folder completely. 
Else it'll remove the file defined in `src`.

## Options

* `name` — Name of the folder in cache

## License

[MIT License](http://en.wikipedia.org/wiki/MIT_License) (c) [<NAME>](http://kevinmartensson.com)<commit_msg>Improve options documentation<commit_after># 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', { name: 'test' });

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

// clean all files inside the test folder inside cache
cache.clean('test.jpg', { name: 'test' });
```

## API

### .store(src, dest, opts)

Store a file inside cache. Use the `name` option to specify a specific folder 
inside cache.

### .get(src, dest, opts)

Get a cached file and save it to a desired location. Use the `name` option to 
look in a specific folder.

### .check(src, opts)

Check if a cached file exists.

### .clean(src, opts)

Clean cache. If the `name` option is specified it'll remove the folder completely. 
Else it'll remove the file defined in `src`.

## Options

### name

Type: `String`  
Default: `undefined`

Name of the folder in cache

## License

[MIT License](http://en.wikipedia.org/wiki/MIT_License) (c) [<NAME>](http://kevinmartensson.com)
{'fraction_non_alphanumeric': 0.15267459138187223, 'fraction_numerical': 0.0, 'mean_word_length': 4.081132075471698, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6376884', 'n_tokens_mistral': 890, 'n_tokens_neox': 867, 'n_words': 304}