
Product
Introducing Rust Support in Socket
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.
vue-persistent-storage-manager
Advanced tools
Vue plugin that wraps the StorageManager API and provides the state of the persistent-storage permission alongside a storage estimate.
Vue plugin that wraps the StorageManager API and provides the state of the
persistent-storage
permission alongside a storage estimate.
persistent-storage
permission.# yarn
$ yarn add vue-persistent-storage-manager
# npm
$ npm install vue-persistent-storage-manager
import Vue from 'vue'
import { VuePersistentStorageManager } from 'vue-persistent-storage-manager'
Vue.use(VuePersistentStorageManager, { watchStorage: true })
Options are not required.
In this case, watchStorage
will default to false
.
Note: If
watchStorage
is set totrue
, the functionslocalStorage.setItem
andlocalStorage.removeItem
are replaced by functions that update the StorageEstimate. The original functions will still be called and are available aslocalStorage.originalSetItem
andlocalStorage.originalRemoveItem
<template>
<div>
<button :disabled="!$storageManager.isAvailable || $storageManager.isPersistent" @click="$storageManager.requestPersistentStorage()">
{{ $storageManager.isPersistent ? 'Persistence granted' : 'Request persistence' }}
</button>
<p>{{ (100 * $storageEstimate.usage) / $storageEstimate.quota }}%</p>
<p>{{ $storageEstimate.usage / 1000000 }}MB</p>
</div>
</template>
plugins/persistentStorageManager.ts
with the following content.import Vue from 'vue'
import { VuePersistentStorageManager } from 'vue-persistent-storage-manager'
export default () => {
Vue.use(VuePersistentStorageManager, { watchStorage: true })
}
plugins
array in nuxt.config.js
.export default {
plugins: [
{ src: '~/plugins/persistentStorageManager.ts' },
],
}
# install dependencies
$ yarn install
# build for production
$ yarn build
# lint project files
$ yarn lint
# run tests
$ yarn test
MIT - Copyright © Jan Müller
FAQs
Vue plugin that wraps the StorageManager API and provides the state of the persistent-storage permission alongside a storage estimate.
The npm package vue-persistent-storage-manager receives a total of 20 weekly downloads. As such, vue-persistent-storage-manager popularity was classified as not popular.
We found that vue-persistent-storage-manager demonstrated a healthy version release cadence and project activity because the last version was released less than 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 now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.
Product
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
Product
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.