1.0.0 • Published 4 years ago

@ivanhanak_com/browser-storage v1.0.0

Weekly downloads
-
License
https://www.imdb....
Repository
github
Last release
4 years ago

"localStorage" alias that doesn't throw errors

npm.io NPM Weekly Downloads

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.