Skip to content

chans-open-source/compatible-storage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Compatible-Storage

Support all browser and Wechat mini program. Quick to set, get and remove the storage.

Install

npm i -save compatible-storage
// or
yarn add compatible-storage

Import

import StorageUtils from 'compatible-storage';

Usage

// Set by default expire time. Default: 30 days.
StorageUtils.set('storage-key', { ...data...});

// Custom expire time. eg: 2 hours.
StorageUtils.set('storage-key', { ...data...}, new StorageUtils.Expire(2, StorageUtils.EXPIRE_UNIT.HOUR));

// Get
const value = StorageUtils.get('storage-key');

// Remove
StorageUtils.remove('storage-key');

About

Support All Browser and Wechat Mini Program.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published