1.0.7 • Published 2 years ago

twt_utils v1.0.7

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

twt_utils 是个工具库(目前只有本地缓存功能,后续继续维护增加~~)

安装

npm i twt_utils
或
yarn install twt_utils

使用

// 未加密缓存
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)

// 使用与上方类似 只是对存储数据进行加密验证
1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago