# bauer-cache

> Disk-cache library.

Latest version **0.1.10** (published 2015-11-26) · MIT license · 0 weekly downloads

## Install

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

## 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.10 |
| Published | 2015-11-26 |
| First published | 2015-06-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Yuri Neves Silveira |
| Maintainers | yneves |
| Keywords | disk, cache, json, expire |

## Links

- npm: https://www.npmjs.com/package/bauer-cache
- Repository: https://github.com/yneves/node-bauer-cache
- Issues: https://github.com/yneves/node-bauer-cache/issues
- npm.io page: https://npm.io/package/bauer-cache

## Dependencies (2)

- [mkdirp](https://npm.io/package/mkdirp.md) ^0.5.1
- [bauer-factory](https://npm.io/package/bauer-factory.md) ^2.0.4

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.1.10 (latest) — 2015-11-26
- 0.1.9 — 2015-09-19
- 0.1.8 — 2015-08-23
- 0.1.7 — 2015-08-08
- 0.1.6 — 2015-07-31
- 0.1.5 — 2015-07-25
- 0.1.4 — 2015-07-19
- 0.1.3 — 2015-06-13
- 0.1.2 — 2015-06-13
- 0.1.1 — 2015-06-07
- 0.1.0 — 2015-06-07

## README

# bauer-cache
Disk-cache library.

## Installation

```
npm install bauer-cache
```

## Usage

```js
var Cache = require("bauer-cache");

var myCache = new Cache({
  file: {
    dir: "./cache",
    name: "filename",
    ext: "json"
  },
  expires: "1d",
  json: true
});

myCache.validate(function(error,isValid) {
  
  if (isValid) {
    
    myCache.read(function(error,data) {
      
    });
    
  } else {
    
    myCache.write({ hello: "world" },function(error) {
      
    });
    
  }
});
```

## API Summary

  * `Cache`
    * `new Cache(options Object) :Cache`
    * `.setMakeDir(mkdir Boolean)` :void
    * `.getMakeDir() :Boolean`
    * `.setJSON(json Boolean) :void`
    * `.isJSON() :Boolean`
    * `.parseJSON(content String, callback Function) :void`
    * `.setFile(options Object) :void`
    * `.setFile(file String) :void`
    * `.getFile() :String`
    * `.setExpiration(time Number) :void`
    * `.setExpiration(expires String) :void`
    * `.getExpiration() :Number`
    * `.read() :Readable`
    * `.read(callback Function) :void`
    * `.write() :Writable`
    * `.write(object Array, callback Function) :void`
    * `.write(object Object, callback Function) :void`
    * `.write(content String, callback Function) :void`
    * `.remove(callback Function) :void`
    * `.exists(callback Function) :void`
    * `.expired(callback Function) :void`
    * `.validate(callback Function) :void`


# License
[MIT](./LICENSE)

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