
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
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 18 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.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.