{"id":49677,"library":"vue2-storage","title":"vue2-storage","description":"Browser storage plugin for Vue.js 2.x applications, providing a reactive wrapper around localStorage, sessionStorage, and memoryStorage. Current version 6.1.3 is stable with TypeScript support. Released under MIT license, it offers a simple API for setting, getting, removing, and clearing stored values with automatic JSON serialization/deserialization. It integrates seamlessly as a Vue plugin, exposing `$storage` on Vue instances, or can be used standalone in vanilla JavaScript. Alternative to vue-ls and vue-localstorage, with focus on minimalism and Vue 2 reactivity.","status":"active","version":"6.1.3","language":"javascript","source_language":"en","source_url":"https://github.com/yarkovaleksei/vue2-storage","tags":["javascript","vue","vuejs","plugin","storage","localStorage","memoryStorage","sessionStorage","typescript"],"install":[{"cmd":"npm install vue2-storage","lang":"bash","label":"npm"},{"cmd":"yarn add vue2-storage","lang":"bash","label":"yarn"},{"cmd":"pnpm add vue2-storage","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required for Vue plugin integration","package":"vue","optional":false}],"imports":[{"note":"Named export; use as a Vue plugin.","symbol":"Vue2StoragePlugin","correct":"import { Vue2StoragePlugin } from 'vue2-storage'"},{"note":"Class for standalone usage without Vue.","wrong":"const Vue2Storage = require('vue2-storage').Vue2Storage","symbol":"Vue2Storage","correct":"import { Vue2Storage } from 'vue2-storage'"},{"note":"TypeScript interface for options object.","symbol":"Vue2StorageOptions","correct":"import type { Vue2StorageOptions } from 'vue2-storage'"}],"quickstart":{"code":"import Vue from 'vue';\nimport { Vue2StoragePlugin } from 'vue2-storage';\n\nVue.use(Vue2StoragePlugin, {\n  namespace: 'myapp_',\n  storage: 'local',\n});\n\nnew Vue({\n  created() {\n    this.$storage.set('key', { foo: 'bar' });\n    console.log(this.$storage.get('key')); // { foo: 'bar' }\n    this.$storage.remove('key');\n    this.$storage.clear();\n  }\n}).$mount('#app');","lang":"typescript","description":"Vue 2 plugin installation with namespace and storage type, setting and getting a JSON value."},"warnings":[{"fix":"Update to import { Vue2StoragePlugin } from 'vue2-storage'.","message":"In version 6.0.0, the import path changed from 'vue2-storage/dist/vue2-storage' to 'vue2-storage'. Also, Vue2StoragePlugin replaces the previous default export.","severity":"breaking","affected_versions":"<6.0.0"},{"fix":"Use the standalone Vue2Storage class directly: import { Vue2Storage } from 'vue2-storage'.","message":"Using the plugin in a non-Vue environment (e.g., plain Node.js) will fail because Vue is a peer dependency and the plugin assumes a Vue instance.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use { storage: 'memoryStorage' } instead of 'memory'.","message":"The 'memory' storage type is deprecated in favor of 'memoryStorage' for consistency with other storage names.","severity":"deprecated","affected_versions":">=4.0.0"}],"env_vars":null,"search_vec":"'2':9,85 '6.1.3':23 'altern':70 'api':37 'applic':11 'around':16 'automat':47 'browser':4 'clear':43 'current':21 'expos':57 'focus':80 'get':40 'instanc':61 'integr':51 'javascript':69,87 'json':48 'licens':32 'localstorag':17,78,92 'ls':74 'memorystorag':20,93 'minim':82 'mit':31 'offer':34 'plugin':6,56,90 'provid':12 'reactiv':14,86 'releas':29 'remov':41 'seamless':52 'serialization/deserialization':49 'sessionstorag':18,94 'set':39 'simpl':36 'stabl':25 'standalon':66 'storag':3,5,58,91 'store':44 'support':28 'typescript':27,95 'use':65 'valu':45 'vanilla':68 'version':22 'vue':55,60,73,77,84,88 'vue-l':72 'vue-localstorag':76 'vue.js':8 'vue2':2 'vue2-storage':1 'vuej':89 'wrapper':15 'x':10","created_at":"2026-06-07T17:03:02.078599+00:00","updated_at":"2026-06-07T17:03:02.078599+00:00","problems":[{"fix":"Ensure Vue is installed and imported before using the plugin. For standalone usage, use Vue2Storage class instead.","cause":"Importing the plugin without Vue installed or importing in a non-Vue context.","error":"Cannot read property 'prototype' of undefined"},{"fix":"Call Vue.use(Vue2StoragePlugin, options) before creating the root Vue instance.","cause":"The plugin was not installed via Vue.use() or used outside of a Vue component context.","error":"TypeError: this.$storage.set is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/yarkovaleksei/vue2-storage#readme","github":"https://github.com/yarkovaleksei/vue2-storage","docs":null,"changelog":null,"pypi":null,"npm":"vue2-storage","openapi_spec":null,"status_page":null,"smithery":null,"categories":["storage"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}