1.0.2 • Published 7 years ago
a-storage v1.0.2
a-storage
a-storage is a simple JavaScript library for easily using WebStorage API.
Install width npm:
npm install --save a-storage
Configuration
Typical Usage:
import Storage, { DRIVERS } from 'a-storage';
const storage = Storage({
dirver: DRIVERS.SESSIONSTORAGE
});
driver
- Select the usage of particular driver.
- default:
LOCALSTORAGE
- available drivers:
driver | description |
---|---|
MEMORY | Use JavaScript Object |
LOCALSTORAGE | Use native localStorage |
SESSIONSTORAGE | Use native sessionStorage |
DOMAINSTORAGE | domainStorage provide by dingtalk |
Promise
- Provide your own
Promise
implemention - default: native
Promise
object