@belloai/ls
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

ls

带有 Base64 加密能力的 LocalStorage

Usage

const Ls = require('@belloai/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') // ''

Readme

Keywords

Package Sidebar

Install

npm i @belloai/ls

Weekly Downloads

4

Version

0.0.1

License

ISC

Unpacked Size

34.8 kB

Total Files

14

Last publish

Collaborators

  • powan
  • elysion72513
  • thomas-ballo
  • ouxiaohui