@2bitlab/ls 中文文档教程
ls
带有
Base64
加密能力的LocalStorage
Usage
const Ls = require('@2bitlab/ls')
const ls = new Ls({
notClearKeys: ['a'],
passLocalStorageB64Key: 'b'
})
ls.set('a', 'aaaa')
ls.get('a') // 'aaaa'
ls.set('c', 'cccc')
ls.get('c') // 'cccc'
ls.getKeys() // ['a','c']
ls.clearAllExcept()
ls.getKeys() // ['a']
ls.get('a') // 'aaaa'
ls.get('c') // ''
ls.clear()
ls.getKeys() // []
ls.set('d', 'dddd')
ls.get('d') // 'dddd'
ls.remove('d')
ls.get('d') // ''