{"repo":"RobinCK/vue-ls","free":true,"listed":false,"github":"https://github.com/RobinCK/vue-ls","clone":"git clone https://github.com/RobinCK/vue-ls.git","description":":boom: Vue plugin for work with local storage, session storage and memory storage from Vue context 🇺🇦","language":"JavaScript","stars":528,"topics":["localstorage","vuejs","local-storage","vue-ls","storage","vue-plugin","vue-local-storage","json","es6-modules","vue"],"license":"MIT","category":"deployment-docker-iac","readme_excerpt":"vue-ls Vue plugin for work with local storage, session storage and memory storage from Vue context jsFiddle Example Vue 1.x Vue 2.x Install CDN Recommended: https://unpkg.com/vue-ls, which will reflect the latest version as soon as it is published to npm. You can also browse the source of the npm package at https://unpkg.com/vue-ls/ Also available on jsDelivr or cdnjs , but these two services take some time to sync so the latest release may not be available yet. NPM Yarn Bower Development Setup Usage Vue storage API. Use in js file Global - Vue.ls Context - this.$ls API Vue.ls.get(name, def) Returns value under name in storage. Internally parses the value from JSON before returning it. - def : default null, returned if not set name . Vue.ls.set(name, value, expire) Persists value under name in storage. Internally converts the value to JSON. - expire : default null, life time in milliseconds name Vue.ls.remove(name) Removes name from storage. Returns true if the property was successfully deleted, and false otherwise. Vue.ls.clear() Clears storage. Vue.ls.on(name, callback) Listen for changes persisted against name on other tabs. Triggers callback when a change occurs, passing the following arguments. - newValue : the current value for name in storage, parsed from the persisted JSON - oldValue : the old value for name in storage, parsed from the persisted JSON - url : the url for the tab where the modification came from Vue.ls.off(name, callback) Removes a listener previously a","default_branch":null,"files":null,"tree":[],"storefront":"/r/RobinCK","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/RobinCK/vue-ls/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}