0.0.2 • Published 7 years ago
hackstorage v0.0.2
#HackStorage
HackStorage is a Javascript Libray that extends native localStorage and sessionStorage which shares the same api with native codes.
##Usage
Download from npm
npm i hackStorage --save-devExample
import HackStorage from 'hackStorage'
let hackLocalStorage = new HackStorage()
let hackSessionStorage = new HackStorage({storage: 'sessionStorage'})
hackLocalStorage.setItem('testLocalStorage', {testKey: 'testValue'}, {expire: 60})
hackSessionStorage.setItem('testSessionStorage', 'testValue', {expire: 60})##API
###setItem
hackStorage.setItem(key, value, options)###getItem
hackStorage.getItem(key)###removeItem Remove determined storage item
hackStorage.removeItem(key)###removeAllExpiredItems Delete all expired storages
hackStorage.removeAllExpiredItems()###clear Delete all storages
hackStorage.clear()