npm.io
2.0.0 • Published 5 years ago

@glenngijsberts/customstorage

Licence
MIT
Version
2.0.0
Deps
0
Size
17 kB
Vulns
0
Weekly
0

CustomStorage

Easy to use wrapper for localStorage API .

Install

# Install
npm install @glenngijsberts/customstorage --save
import CustomStorage from '@glenngijsberts/customstorage'

Usage

/*
    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

# 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

Contribution

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.

License

MIT