clstorage

1.0.7 • Public • Published

storage 工具类封装

参数

  • mode: storage类型,localStorage, sessionStorage 默认值 local 可选值:['local', 'session']
  • timeout: 超时时间

使用方法

import clstorage from 'clstorage'
const storage = new clstorage({
  mode: 'local',
  timeout: 30 * 1000
})

-- 缓存数据
storage.setitem(key, valur)
-- 读取数据
storage.getItem(key)
-- 删除数据
storage.removeItem(key)
-- 删除所有
storage.clear()

Readme

Keywords

none

Package Sidebar

Install

npm i clstorage

Weekly Downloads

0

Version

1.0.7

License

ISC

Unpacked Size

7.73 kB

Total Files

7

Last publish

Collaborators

  • amwcel107