# twt_utils

> ```js npm i twt_utils 或 yarn install twt_utils ```

Latest version **1.0.7** (published 2022-06-16) · ISC license · 0 weekly downloads

## Install

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

## 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.7 |
| Published | 2022-06-16 |
| First published | 2021-12-03 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 20.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | twt0308 |

## Links

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

## Dependencies (1)

- [crypto-js](https://npm.io/package/crypto-js.md) ^4.1.1

## Recent versions

- 1.0.7 (latest) — 2022-06-16
- 1.0.6 — 2022-02-18
- 1.0.5 — 2022-02-18
- 1.0.4 — 2022-02-18
- 1.0.3 — 2022-02-18
- 1.0.2 — 2022-02-18
- 1.0.1 — 2022-02-18
- 1.0.0 — 2021-12-03

## README

### twt_utils 是个工具库（目前只有本地缓存功能，后续继续维护增加~~）

### 安装
```js
npm i twt_utils
或
yarn install twt_utils
```

### 使用
```js
// 未加密缓存
import { Cache } from 'twt_utils'

// key 存储键值; value stgring类型值; isLocal 默认为true使用local存储，否则使用session
Cache.setCache(key, value, isLocal);

// key 存储键值; isLocal 默认为true使用local存储，否则使用session
Cache.getCache(key, isLocal) // 获取某值

// key 存储键值; isLocal 默认为true使用local存储，否则使用session
Cache.deleteCache(key, isLocal) // 删除某值

// 清理所有缓存
Cache.clearCache()



// 使用加密方案

import { EncryptedCache } from 'twt_utils'

// key 加密密文
const Cache = new EncryptedCache(key: string)

// 使用与上方类似 只是对存储数据进行加密验证
```

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