local-storage-data
v1.0.5
Published
Small piece of code handle local storage simplify
Downloads
3
Maintainers
Readme
local-storage-data
Small piece of code handle localstorage simplify
Installation
NPM
npm install local-storage-data
YARN
yarn add local-storage-data
Usage
import package first
import localStorageData from 'local-storage-data'
Set
const userData = {
name: 'rudestewing',
age: 25,
}
localStorageData.set('user', userData)
if you want to make it temporary just add duration to third parameter
localStorageData.set('user', userData, (60*60*24))
Get
const user = localStorageData.get('user')
Remove
localStorageData.remove('user')