
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
localforage-nuxt
Advanced tools
This package is just a replacement for official package @nuxtjs/localforage, because
the official package had not been updated recently and also there's a typo error in plugin.js
. The changes included two:
getItemSync
and setItemSync
for Synchronize method calllocalforage
dependency to latest version 1.7.3
plugin.js
for setDriver
method$localForage
instance into nuxtjs context
objectlocalforage-nuxt
dependency using yarn
or npm
to your projectlocalforage-nuxt
to modules
section of nuxt.config.js
{
modules: [
// Simple usage
'localforage-nuxt'
]
}
nuxt.config.js
{
// You can pass options in modules
modules: [
// With options
['localforage-nuxt', {
driver : localforage.WEBSQL, // Force WebSQL; same as using setDriver()
name : 'myApp',
version : 1.0,
size : 4980736, // Size of database, in bytes. WebSQL-only for now.
storeName : 'keyvaluepairs', // Should be alphanumeric, with underscores.
description : 'some description'
}],
],
// OR localforage object
localforage: {
driver : localforage.WEBSQL, // Force WebSQL; same as using setDriver()
name : 'myApp',
version : 1.0,
size : 4980736, // Size of database, in bytes. WebSQL-only for now.
storeName : 'keyvaluepairs', // Should be alphanumeric, with underscores.
description : 'some description'
}
}
The preferred driver(s) to use. Same format as what is passed to setStorageDriver()
, above.
Default: [localforage.INDEXEDDB, localforage.WEBSQL, localforage.LOCALSTORAGE]
The name of the database. May appear during storage limit prompts. Useful to use the name of your app here. In localStorage, this is used as a key prefix for all keys stored in localStorage.
Default: 'localforage'
The size of the database in bytes. Used only in WebSQL for now.
Default: 4980736
The name of the datastore. In IndexedDB this is the dataStore, in WebSQL this is the name of the key/value table in the database. Must be alphanumeric, with underscores. Any non-alphanumeric characters will be converted to underscores.
Default: 'keyvaluepairs'
The version of your database. May be used for upgrades in the future; currently unused.
Default: 1.0
A description of the database, essentially for developer usage.
Default: ''
More informations on LocalForage documentation
let item = await this.$localForage.getItem(key)
let item = this.$localForage.getItemSync(key)
await this.$localForage.setItem(key, value)
this.$localForage.setItemSync(key, value)
await this.$localForage.removeItem(key)
await this.$localForage.clear
let length = await this.$localForage.length
let k = await this.$localForage.key(keyIndex)
let keys = await this.$localForage.keys()
this.$localForage.setDriver(localforage.LOCALSTORAGE)
By default, localForage selects backend drivers for the datastore in this order:
If you would like to force usage of a particular driver you can use $setStorageDriver() with one or more of the following parameters.
localforage.INDEXEDDB
localforage.WEBSQL
localforage.LOCALSTORAGE
yarn install
or npm install
npm run dev
FAQs
Localforage module for Nuxt.js(enhancement)
We found that localforage-nuxt demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.