Registry / storage / responsive-storage

responsive-storage

JSON →
library2.2.0jsnpmunverified

Responsive local storage plugin for Vue 2 and Vue 3 (v2.2.0). Persists reactive state to localStorage with automatic syncing. Supports tree-shaking, custom namespacing, and zero additional dependencies. Lightweight (~1.76 KB source). Differentiator: maintains reactivity across page refreshes without Vuex/Pinia, and works with both Vue major versions. Released under MIT, maintained on GitHub.

storage
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Package uses default export. CommonJS require works but TypeScript may complain about types.

import Storage from 'responsive-storage'

For Vue 2, pass version: 2. For Vue 3, do not pass version. Vue 3 uses app.use().

Vue.use(Storage, { version: 2, memory: { ... } })

Custom nameSpace must match between plugin options and getData call. Default nameSpace is 'rs-'.

Storage.getData('key', 'namespace')

Shows how to install the plugin and define reactive local storage items with defaults in Vue 3.

// Vue 3 main.ts import { createApp } from 'vue' import App from './App.vue' import Storage from 'responsive-storage' const app = createApp(App) app.use(Storage, { memory: { count: Storage.getData('count') ?? 0, user: Storage.getData('user') ?? { name: '' } } }) app.mount('#app')
Debug
Known footguns
gotchaCustom nameSpace must be consistent between plugin options and Storage.getData calls.
gotchaVue 2 requires passing version: 2 in options; Vue 3 must NOT pass version.
gotchaStorage.getData returns undefined if key does not exist; must provide fallback with ?? operator.
deprecatedNo known deprecations yet.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
0 hits · last 30 days

No traffic data recorded yet.

Resources