0.1.4 • Published 2 years ago

@7inch/storage v0.1.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@7inch/storage

npm

English | 中文

Introduction

A basic library wrapper with localStorage and sessionStorage, base on Typescript and rollup.

Install

npm i @7inch/storage

Usage

Take localStorage for example(same as sessionStorage):

import { localStore, sessionStore } from "@7inch/storage";

// set a data item
localStore.set("foo", 10);
// get a data item
localStore.get("foo");
// remove a data item
localStore.remove("foo");
// check a data item if exists
localStore.has("foo");
// clear all items
localStore.clear();

License

Made with ❤️ Published under MIT License.