# cloud-kv-cache

> Simple abstraction for a caching key/vale store. Supports in memory or redis.

Latest version **1.0.0** (published 2018-05-27) · ISC license · 0 weekly downloads

## Install

```sh
npm install cloud-kv-cache
pnpm add cloud-kv-cache
yarn add cloud-kv-cache
bun add cloud-kv-cache
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2018-05-27 |
| First published | 2018-05-27 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.7 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Andrew Peebles |
| Maintainers | aqpeeb |

## Links

- npm: https://www.npmjs.com/package/cloud-kv-cache
- Repository: https://github.com/peebles/cloud-cache
- Homepage: https://github.com/peebles/cloud-cache#readme
- Issues: https://github.com/peebles/cloud-cache/issues
- npm.io page: https://npm.io/package/cloud-kv-cache

## Dependencies (1)

- [redis](https://npm.io/package/redis.md) ^2.8.0

## Recent versions

- 1.0.0 (latest) — 2018-05-27

## README

# Cloud Cache

A very simple abstraction of a key/value store that can be configured as im-memory for
local testing, or with a pointer to a redis host for deployment.  Supports TTL when 
using redis.

## Usage 

```javascript
cache = require( 'cloud-cache' )({
  type: 'memory' or 'redis',
  options: {
    ttl:  ttl for redis in seconds
    connection: {
      port: redis-port,
      host: redis-host
    }
  }
});

cache.set( 'key', { value: 15 }, (err) => {
  if ( err ) console.log( err );
});

cache.get( 'key', (err, val) => {
  if ( err ) console.log( err );
  else console.log( JSON.stringify( val, null, 2 ) );
});

cache.del( 'key', (err) => {
  if ( err ) console.log( err );
});
```

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