1.0.0 • Published 4 years ago
@ivanhanak_com/browser-storage v1.0.0
"localStorage" alias that doesn't throw errors
A simple wrapper around localStorage
API, that does not throw errors.
Changelog
See the whole Changelog.
Install
Using npm:
npm install @ivanhanak_com/browser-storage
Using yarn:
yarn add @ivanhanak_com/browser-storage
Import
import BrowserStorage from '@ivanhanak_com/browser-storage';
Usage
//the same
localStorage.getItem(key);
BrowserStorage.getItem(key);
//the same
localStorage.setItem(key, value);
BrowserStorage.setItem(key, value);
//the same
localStorage.removeItem(key);
BrowserStorage.removeItem(key);
Browser support
Exactly as the localStorage API.
1.0.0
4 years ago