2.0.0 • Published 1 year ago

@qingmo/expire-local-storage v2.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

expire-local-storage

让localstorage支持设置过期时间

install

npm install expire-local-storage --save-dev

usage

import createStorage from 'expire-local-storage'
const store = createStorage()
// set
store.setItem('test',{a:1}, 1000) // key value expire ms
// get
const val = store.getItem('test') // {a:1}
// get all storage both set from store and H5 localstorage
cosnt res = store.getAllItem()
// remove
store.removeItem(test)
store.removeAll()
2.0.0

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago