Skip to content
This repository has been archived by the owner on May 30, 2024. It is now read-only.

Latest commit

 

History

History
45 lines (29 loc) · 1013 Bytes

README.ZH_CN.MD

File metadata and controls

45 lines (29 loc) · 1013 Bytes

storage4ns.js

优雅的、含命名空间的 LocalStorage 解决方案.

GitHub stars GitHub license Rate on Openbase

NPM

English Doc

Installation

npm install storage4ns --save

or

yarn add storage4ns

DEMO

import NStorage from "storage4ns";

const nstorage = new NStorage("sys-admin");

// 存
nstorage.put("access-token", "token-secret");

// 取
let userName = nstorage.get("user-name");
console.log(userName);

// 删
nstorage.remove("user-name");

// 清
nstorage.clear();