# wfilesfiltercaching

> Filter for wFiles provider's that caches file stats, names and records.

Latest version **0.5.28** (published 2018-08-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install wfilesfiltercaching
pnpm add wfilesfiltercaching
yarn add wfilesfiltercaching
bun add wfilesfiltercaching
```

## 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.5.28 |
| Published | 2018-08-06 |
| First published | 2017-09-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 41.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Kostiantyn Wandalen |
| Maintainers | wandalen |
| Keywords | wTools, wFiles, file, read file, write file |

## Links

- npm: https://www.npmjs.com/package/wfilesfiltercaching
- Repository: https://github.com/Wandalen/wFilesFilterCaching
- Homepage: https://github.com/Wandalen/wFilesFilterCaching#readme
- Issues: https://github.com/Wandalen/wFilesFilterCaching/issues
- npm.io page: https://npm.io/package/wfilesfiltercaching

## Dependencies (7)

- [wProto](https://npm.io/package/wProto.md)
- [wTools](https://npm.io/package/wTools.md)
- [chokidar](https://npm.io/package/chokidar.md)
- [fs-extra](https://npm.io/package/fs-extra.md)
- [wConsequence](https://npm.io/package/wConsequence.md)
- [wRegexpObject](https://npm.io/package/wRegexpObject.md)
- [wpathfundamentals](https://npm.io/package/wpathfundamentals.md)

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 0.5.28 (latest) — 2018-08-06
- 0.5.27 — 2018-07-31
- 0.5.26 — 2018-07-30
- 0.5.25 — 2018-07-18
- 0.5.24 — 2018-07-17
- 0.5.23 — 2018-07-17
- 0.5.22 — 2018-07-16
- 0.5.21 — 2018-07-14
- 0.5.20 — 2018-07-05
- 0.5.19 — 2018-06-13
- 0.5.18 — 2018-06-07
- 0.5.17 — 2018-04-12
- 0.5.16 — 2018-04-09
- 0.5.15 — 2018-01-11
- 0.5.14 — 2017-09-28
- … 1 more at https://npm.io/package/wfilesfiltercaching/versions

## README

# wFilesFilterCaching [![Build Status](https://travis-ci.org/Wandalen/wFilesFilterCaching.svg?branch=master)](https://travis-ci.org/Wandalen/wFilesFilterCaching)


Filter that works same like original provider, but additionally updates it own file stats, names and [record]( https://github.com/Wandalen/wFiles/blob/master/wFileRecord.md ) caches. Each cache is a map with file path as a key and cached data as value. Also filter can use file watcher to update cache on changes made by other processes. To perform behavior of original provider filter wraps its methods.

### Installation
```npm install wfilesfiltercaching ```

### Usage

#### Options
* original  { object }[ optional, default : default provider on target platform ] - provider to wrap.
* cachingDirs  { boolean }[ optional, default : 1 ] - enables updates of files list cache;
* cachingStats { boolean }[ optional, default : 1 ] - enables updates of file stats cache;
* cachingRecord { boolean }[ optional, default : 1 ] - enables updates of file record cache;
* updateOnRead { boolean }[ optional, default : 0 ] - update each cache after file read operation;
* watchPath { string }[ optional, default : null ] -  path for file watcher, if specified file watcher will start;
* watchOptions { object }[ optional, default : {} ] - file watcher options.

Please visit [ wFiles ]( https://github.com/Wandalen/wFiles ) for information about providers.

###### Example
```javascript
var caching = _.FileFilter.Caching();

/* make file operation like real provider*/

var filePath = 'path/to/file';
var stats = cachingStats.fileStat( filePath );
console.log( stats );

/* get file stats cache */
console.log( "Stats: ", caching._cacheStats );

```

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