Easy to use wrapper for localStorage API 🧠.
# Install
npm install @glenngijsberts/customstorage --save
import CustomStorage from '@glenngijsberts/customstorage'
/*
get item
*/
const token = CustomStorage.get('token')
/*
set: token, value, cachetime
*/
const token = 'AABB12'
CustomStorage.set('token', token, 60)
/*
remove item
*/
CustomStorage.remove('token')
/*
clear storage (all items)
*/
CustomStorage.clear()
# clone the repo
git clone https://github.com/glenngijsberts/CustomStorage.git
# install dependencies / or npm install
yarn
# tests / or npm run test
yarn test
# build / or npm run prepare
yarn prepare
Feel free to contribute to this package. If you have any questions you can reach out to me on twitter 😄 This package is inspired by this vue tabs package from the guys at spatie.
MIT