# @cjs-front-end/storage

> Web side Toast

Latest version **0.0.3** (published 2023-02-21) · 0 weekly downloads

## Install

```sh
npm install @cjs-front-end/storage
pnpm add @cjs-front-end/storage
yarn add @cjs-front-end/storage
bun add @cjs-front-end/storage
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2023-02-21 |
| First published | 2023-02-21 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | wukai@e2pai.net |
| Maintainers | energytime |

## Links

- npm: https://www.npmjs.com/package/@cjs-front-end/storage
- Homepage: https://github.com/cjs-front-end/storage#readme
- Issues: https://github.com/cjs-front-end/storage/issues
- npm.io page: https://npm.io/package/@cjs-front-end/storage

## Recent versions

- 0.0.3 (latest) — 2023-02-21
- 0.0.2 — 2023-02-21
- 0.0.1 — 2023-02-21
- 0.0.4 — 2023-02-21

## README

# @yipai-front-end/storage

## 介绍

​ **强化版 localStorage，在 get set 阶段可自动解析 value 数据类型。**

## 基本用法

### 安装

```bash
npm i @yipai-front-end/storage
```

### 使用示例

```js
import { setStorage, getStorage, removeStorage } from '@yipai-front-end/storage'

let info = {
  name: '张三',
  age: 20,
}

setStorage('data', info)

let data = getStorage('data') // 获取到object类型的info

removeStorage('data') // 删除缓存值
```

## function

| 方法                   | 返回值 | 方法说明                                         |
| ---------------------- | ------ | ------------------------------------------------ |
| setStorage(key, value) | void   | 自动解析 value 类型，并存储到 localStorage       |
| getStorage(key)        | any    | 读取 localStorage 指定的 key，并自动解析类型返回 |
| removeStorage(key)     | void   | 删除 localStorage 的某一个 key                   |

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