s-localstorage
Is a simple library for work with local storage or session storage. Supported types:
array
, number
, boolean
, object*
Supported object or array if they not included types like function, symbol, etc.
Install
run
npm i s-localstorage
Usage
localStorageclearlocalStoragelocalStoragelocalStorage sessionStorageclearsessionStoragesessionStoragesessionStorage
You can use defaultValue
for get method (default it is null)
localStorage
If browser not supported localStorage or sessionStorage you find console error message,
but all method should works (method get
return null or default value)