localforage-driver-userscript-values
v0.2.0
Published
A localForage driver for userscripts to access the value storage of userscript engines e.g. Tampermonkey.
Downloads
6
Readme
localForage-driver-userscript-values
A localForage driver for userscripts to access the value storage of userscript engines e.g. Tampermonkey.
Usage
const localForage = require('localforage')
const UserScriptValues = require('localforage-driver-userscript-values')
localForage.defineDriver(UserScriptValues) // can be used as sync functions
localForage.setDriver(UserScriptValues.NAME)
localForage.config({
name: 'app',
storeName: 'store'
})
localForage.getItem('key') // equals to GM_getValue('app/store/key', null)
.then(v => console.log(v))