@abarchibody/storage 中文文档教程
storage 用于读取、写入localstorage。
安装
$ npm i @abarchibody/storage
用法
const data = [1, 2, 3, 4]
import storage from '@abarchibody/storage'
Write to localstorage
storage.set('data', data);
OR
storage.write('data', data);
Read to localstorage
const myData = storage.get('data')
OR
const myData = storage.read('data')
console.log(myData)
// [1, 2, 3, 4]
Delete data to localstorage
storage.remove('data');
OR
storage.del('data');
storage is used to read, write to the localstorage.
to install
$ npm i @abarchibody/storage
Usage
const data = [1, 2, 3, 4]
import storage from '@abarchibody/storage'
Write to localstorage
storage.set('data', data);
OR
storage.write('data', data);
Read to localstorage
const myData = storage.get('data')
OR
const myData = storage.read('data')
console.log(myData)
// [1, 2, 3, 4]
Delete data to localstorage
storage.remove('data');
OR
storage.del('data');