storagepoly
v1.0.1
Published
A polyfill for localStorage and sessionStorage for those times when they're undefined.
Downloads
3
Maintainers
Readme
Storage Poly |
A polyfill for localStorage and sessionStorage for those times when they're undefined.
Requirements
- Node 6+
Install
yarn add storagepoly
or npm install storagepoly -S
Usage
import 'storagepoly'; // or require('storagepoly')
// Setting
localStorage.setItem('myItem', 'My stored value');
// Getting
const myItem = localStorage.getItem('myItem');
// Removing
localStorage.removeItem('myItem');
// Clearing
localStorage.clear();
API
localStorage
: Mirrors api ofwindow.localStorage
DOCSsessionStorage
: Mirrors api ofwindow.sessionStorage
DOCS
Questions?
Bugs?
License
This project is distributed under the MIT license.