# s-memory-cache

> Simple memory cache

Latest version **1.0.1** (published 2021-05-23) · ISC license · 0 weekly downloads

## Install

```sh
npm install s-memory-cache
pnpm add s-memory-cache
yarn add s-memory-cache
bun add s-memory-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.1 |
| Published | 2021-05-23 |
| First published | 2021-05-23 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | renan |
| Maintainers | nrenan |

## Links

- npm: https://www.npmjs.com/package/s-memory-cache
- Repository: https://github.com/rporcon/simple-memory-cache
- Homepage: https://github.com/rporcon/simple-memory-cache#readme
- Issues: https://github.com/rporcon/simple-memory-cache/issues
- npm.io page: https://npm.io/package/s-memory-cache

## Recent versions

- 1.0.1 (latest) — 2021-05-23
- 1.0.0 — 2021-05-23

## README

# simple-memory-cache

A simple memory cache for javascript with no dependencies, built with ES6 proxy

## How to install

`npm i s-memory-cache`

## How to use

Basic use:

```javascript
const initCache = require('s-memory-cache');

const cacheObj = initCache({ refreshCache: 15000, refreshCacheElem: 5000 });

cacheObj['cacheKey1'] = 'hello world';
cacheObj['cacheKey2'] = 'こんにちは世界';
```

Cache anything you want in `cacheObj`

The initCache function have two optional parameters:

- `refreshCache`: When will the whole cache be reset (in ms)
- `refreshCacheElem`: When will the created cache element be reset (in ms)

When the cache element is reset it become `null`

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