# @deot/helper-cache

> 浏览器缓存工具，统一提供 `Storage`、`Cookie` 和 `IndexedDB` 风格的 `get`、`set`、`remove` 接口。

Latest version **1.1.10** (published 2026-04-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @deot/helper-cache
pnpm add @deot/helper-cache
yarn add @deot/helper-cache
bun add @deot/helper-cache
```

## Health

**Score 45/100 (D)** — status: active.

Positive: no vulnerabilities.

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

## Facts

| | |
|---|---|
| Version | 1.1.10 |
| Published | 2026-04-07 |
| First published | 2023-07-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | deot |

## Links

- npm: https://www.npmjs.com/package/@deot/helper-cache
- npm.io page: https://npm.io/package/@deot/helper-cache

## Recent versions

- 1.1.10 (latest) — 2026-04-07
- 1.1.9 — 2026-03-05
- 1.1.8 — 2026-03-02
- 1.1.7 — 2025-10-08
- 1.1.6 — 2025-03-28
- 1.1.5 — 2024-06-28
- 1.1.4 — 2024-06-27
- 1.1.3 — 2023-11-22
- 1.1.2 — 2023-11-16
- 1.1.1 — 2023-08-25
- 1.1.0 — 2023-08-24
- 1.0.3 — 2023-08-21
- 1.0.2 — 2023-08-17
- 1.0.1 — 2023-07-13

## README

# @deot/helper-cache

缓存管理（`Storage` / `Cookie` / `IndexedDB`）

### `Storage/Cookie/IndexedDB`

> IndexedDB 返回的是`Promise`

```js
import { Cookie, Storage, IndexedDB } from '@deot/helper-cache';
```

```js
// or
import { Cookie, Storage, IndexedDB } from '@deot/helper';
```

---

#### `get`

`Storage.get(key: string, options?: object)`

获取缓存中对应的值

+ **key**: 键值
+ **options**: 配置项

**示例**
```js
Storage.get('key');
```

---

#### `set`

`Storage.set(key: string, value: any, options?: object)`

设置缓存

+ **key**: 键值
+ **value**: 缓存
+ **options**: 配置项

**示例**
```js
Storage.set('key', {});
```

---

#### `remove`

`Storage.remove(key: string, options?: object)`

清楚缓存

+ **key**: 键值
+ **options**: 配置项

**示例**
```js
Storage.remove('key');
```

---

#### `configure`

`Storage.configure(options: object)`

设置版本号

+ **options**: 配置项

**示例**
```js
Storage.configure({ version: '1.0.0', keepVersions: [] });
```

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