Local and session storage with JSON support
import{localStorage,sessionStorage,JSONStorage}from'uc-storage'sessionStorage.setItem('name','value')conststorage=JSONStorage(localStorage)storage.set('data',[1,2,3])constdata=storage.get('data')console.log(Array.isArray(data));// trueThis module exports the safe localStorage, sessionStorage with API identical to browser's.
Wraps the storage object to save and parse JSON data inside the storage
Sets the value
Returns the value
Removes the key from the storage
License MIT
© velocityzen