# lowcache

> simple cache with time in NodeJS

Latest version **1.0.1** (published 2022-08-30) · MIT license · 0 weekly downloads

## Install

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

## 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 | 2022-08-30 |
| First published | 2022-08-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | rockedpanda |
| Maintainers | rockedpanda |
| Keywords | cache, time, nodejs |

## Links

- npm: https://www.npmjs.com/package/lowcache
- npm.io page: https://npm.io/package/lowcache

## Alternatives

- [@js-joda/timezone](https://npm.io/package/@js-joda/timezone.md) — 383.4K weekly downloads
- [chartjs-adapter-moment](https://npm.io/package/chartjs-adapter-moment.md) — 210.8K weekly downloads
- [strftime](https://npm.io/package/strftime.md) — 171.2K weekly downloads
- [vue-flatpickr-component](https://npm.io/package/vue-flatpickr-component.md) — 115.8K weekly downloads
- [timepicker](https://npm.io/package/timepicker.md) — 51.0K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2022-08-30
- 1.0.0 — 2022-08-30

## README

# 简单的内存数据缓存

## 用途

带有缓存时间的简单的NodeJS存储, 支持set/get/del

定义如下:
```javascript
/**
 * 带有时间有效期的简单缓存机制
 * @param {Number} timeLength 缓存有效期,以秒为单位; 当timeLenth为0时表示永久有效;默认为0;
 * @param {Number} autoClearTime 缓存检查周期,以秒为单位; timeLenth为0时无效; 默认值为timeLength的10倍;
 */
function LowCache(timeLength, autoClearTime){
}

```

## 用法举例

```javascript
const LowCache = require('lowcache');
let cache = new LowCache(10, 20); //缓存周期10s, 自动清理周期20s;
cache.set('a','1111');
cache.set('b','2222');

console.log(cache.get('a'));
setTimeout(function(){
	console.log('after 9s: ',cache.get('a'));
}, 9000);
setTimeout(function(){
	console.log('after 12s: ',cache.get('a'));
}, 12000);
setTimeout(function(){
	console.log('after 22s: ',cache.get('b'));
}, 22000);

```

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