JSON Web Storage
Simple localStorage/sessionStorage wrapper providing the exact same API with automatic JSON serialization.
Installation
With npm (for Browserify/Webpack):
npm install --save json-web-storage
Usage
The API is identical to the standard Web Storage API. The only difference is that the items we put/get are automatically serialized/unserialized with JSON.stringify() and JSON.parse().
Example
; jsonLocalStorage;let num = jsonLocalStorage;console // => numberconsole // => 123.45 jsonLocalStorage;let obj = jsonLocalStorage;console // => objectconsole // => John
License
MIT