Nihilist Pocket Monsters

    localforage-driver-userscript-values
    TypeScript icon, indicating that this package has built-in type declarations

    0.2.0 • Public • Published

    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))

    Install

    npm i localforage-driver-userscript-values

    DownloadsWeekly Downloads

    4

    Version

    0.2.0

    License

    MIT

    Unpacked Size

    19.9 kB

    Total Files

    13

    Last publish

    Collaborators

    • momocow