storagepoly

1.0.1 • Public • Published

Storage Poly | CircleCI Coverage Status

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 of window.localStorage DOCS
  • sessionStorage: Mirrors api of window.sessionStorage DOCS

Questions?

@sturdynut

Bugs?

Submit a bug

License

This project is distributed under the MIT license.

Package Sidebar

Install

npm i storagepoly

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

138 kB

Total Files

9

Last publish

Collaborators

  • sturdynut