A Vue 3 plugin for working with local storage, session storage, and WebSQL from the Vue context, inspired by tarojs and vue-ls. Current stable version 0.1.11 supports Vue 3.x only. Provides both synchronous and asynchronous APIs with TypeScript types, namespace support, and expiration handling. Differentiators include promise-based async storage, sync/async methods, and built-in expiration checking. Package is small, with peer dependencies on core-js and vue.
npm install vue3-storageNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows plugin registration, sync and async storage operations, and expiration handling.
Ensure useStorage() is called within the setup context of a Vue component.
Explicitly set namespace to an empty string or your desired prefix.
Plan configuration at app creation; re-create app if you need different settings.
Prefer async methods (setStorage, getStorage) for non-blocking operations.
Move the call inside setup() or <script setup> of a Vue component.
Use ES module import: import Vue3Storage from 'vue3-storage'
Provide options object with namespace: { namespace: 'yourNamespace_', storage: StorageType.Local }