@qingmo/expire-local-storage
v2.0.0
Published
make your localStorage more flexible
Downloads
1
Readme
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()