Skip to content

This is a "localStorage" and "sessionStorage" processing

Notifications You must be signed in to change notification settings

harrydengchao/storage-format

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

storage-format

Install

$ npm i -S storage-format

Uasge

  • s.local use window.localStorage
  • s.session use window.sessionStorage
import s from 'storage-format'

s.local.setItem('name', 'tom')
s.local.getItem('name')
// output: "tom"
s.local.removeItem('name')

s.local.setItem('a.b.c', '123')
s.local.getItem('a.b')
// output: {c: "123"}
s.local.removeItem('a.b')
s.local.clear()

s.session.setItem('a.b.c', '123')
s.session.getItem('a.b')
// output: {c: "123"}
s.session.removeItem('a.b')
s.session.clear()

About

This is a "localStorage" and "sessionStorage" processing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published