Vue.js localStorage plugin with types support

Overview

VueLocalStorage

CircleCI status npm version npm downloads

LocalStorage plugin inspired by Vue typed props which take a care of typecasting for Vue.js 1 and 2 with SSR support.

Install

npm install vue-localstorage --save

or

bower install vue-localstorage

Usage

import VueLocalStorage from 'vue-localstorage'

Vue.use(VueLocalStorage)
// Or you can specify any other name and use it via this.$ls, this.$whatEverYouWant
Vue.use(VueLocalStorage, {
  name: 'ls',
  bind: true //created computed members from your variable declarations
})

// Use localStorage from Vue object
Vue.localStorage.set('someNumber', 123)
Vue.localStorage.get('someNumber')

// Fallback value if nothing found in localStorage
Vue.localStorage.get('propertyThatNotExists', 'fallbackValue') // Will return 'fallbackValue' string

// Default type if value isn't registered in localStorage section
Vue.localStorage.get('property', null, Number)

//register localStorage variables and adds computed variables to local components
//to be used like regular computeds that are stored in the localstorage
var vm = new Vue({
  localStorage: {
    someObject: {
      type: Object,
      default: {
        hello: 'world'
      }
    },
    someNumber: {
      type: Number,
    },
    someBoolean: {
      type: Boolean
    },
    stringOne: '',
    stringTwo: {
      type: String,
      default: 'helloworld!'
    },
    stringThree: {
      default: 'hello'
    }
  },
  methods: {
    someMethod () {
      let lsValue = this.$localStorage.get('someObject')
      this.$localStorage.set('someBoolean', true)
      this.$localStorage.remove('stringOne')
    }
  }
})

License

MIT

Comments
  • Fetching data from the localStorage on hard refresh via (vue-router) does not respect properties of given variables.

    Fetching data from the localStorage on hard refresh via (vue-router) does not respect properties of given variables.

    For example in vue-router:

    router.beforeEach((to, from, next) => {
      let user = Vue.localStorage.get('user') 
    })
    

    If the request comes from in-app routing user is indeed an object. But if we hard refresh the page user is still a string (JSON.stringified).

    Update After digging around I found out that the properties object was empty. So the type of the object user is a string, therefore no JSON object parsing has happened. The vue-router triggers the global beforeEach method before the vue-local-storage component could initialize its properties.

    bug help wanted 
    opened by anthdm 11
  • automatically create getter and setters (computed) from localStorage keys?

    automatically create getter and setters (computed) from localStorage keys?

    Maybe I missed this feature, but to me, this would feel very natural and is somewhat in line with how firebase/vuefire works.

    It might break things for some people though, so it is optional, though it should be the default behavior imho.

    Thanks for your time :) Cheers!

    JM

    opened by dasdeck 8
  • [0.4.1] Uncaught TypeError: __webpack_require__.i is not a function

    [0.4.1] Uncaught TypeError: __webpack_require__.i is not a function

    Hi. When I update 0.3.0 -> 0.4.1 and running

    cross-env NODE_ENV=development webpack --watch --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
    

    defined inside my admin.js as

    import VueLocalStorage from 'vue-localstorage';
    
    Vue.use(VueCookie);
    Vue.use(Clipboard);
    Vue.use(PortalVue);
    Vue.use(VueLocalStorage);
    

    everything compiled just fine but in the browser Im getting: Uncaught TypeError: __webpack_require__.i is not a function. image

    Reverting back to 0.3.0 fixes everything.

    My webpack config is rather large, but I can share some parts if you need details. Just let me know that you'll need.

    opened by Uriziel01 7
  • How to use it in SSR

    How to use it in SSR

    As mentioned above, when I use it in a SSR project, it throws some error. Error message: image So could you please give me some examples about how to use it in SSR? My code is just like this: app.js

    import VueLocalStorage from 'vue-localstorage'
    Vue.use(VueLocalStorage, {
      name: 'ls'
    })
    

    And my login.vue: image

    Thanks in advance!

    opened by noprom 6
  • Make static method available

    Make static method available

    I'm pretty new to vue so correct me if I was wrong. I think it's better to provide ability to call get/set/remove outside vue instance, like in vuex actions. Vuex and vue-router can do that. I don't know how to access the instance method in vuex action, where I guess all side-effect should be put in. (like redux-saga)

    I just make install a static method of VueLocalStorage class, and export the class, it works. I can make a PR later if this is okay.

    enhancement 
    opened by LabiKyo 6
  • Request: add a second argument to get for default value

    Request: add a second argument to get for default value

    It would help to shave a few lines for testing if it's null or not and you have to initialize an array or an object so you can add values to it.

    Example:

    let storedData = this.$localStorage.get('storedData', {});
    

    instead of

    let storedData = this.$localStorage.get('storedData');
    if (storedData === null) {
        storedData = {}
    }
    
    enhancement 
    opened by cdarken 5
  • Unable to have Array properly stored in localstorage

    Unable to have Array properly stored in localstorage

    I have my type as Array and can't seem to figure out why this isn't working properly. VueLocalStorage._properties is somehow still {} and then defaults to type of String.

    help wanted 
    opened by malonehedges 5
  • Allow setting namespace for localStorage keys [close #26]

    Allow setting namespace for localStorage keys [close #26]

    • Add namespace property to VueLocalStorage;
    • Add wrapper around localStorage.setItem and localStorage[key] in order to modify key;
    • Make build script portable.
    • Add tests
    opened by nikolay-borzov 4
  • Check, if localStorage is available and usable before using it

    Check, if localStorage is available and usable before using it

    The plugin relies on an always accessible and writable localStorage which (at least in our case) leads to alot of errors if its not available.

    It would be easy to prevent those errors if a small check would be implemented first or something similar to the solution described here: https://stackoverflow.com/questions/21159301/quotaexceedederror-dom-exception-22-an-attempt-was-made-to-add-something-to-st

    let isSupported;
    
    try {
      localStorage.setItem('vue-localstorage', '');
      localStorage.removeItem('vue-localstorage');
    
      isSupported = true;
    } catch (err) {
      isSupported = false;
    }
    
    bug 
    opened by fraaalk 3
  • Can we just import the VueLocalStorage class?

    Can we just import the VueLocalStorage class?

    First off - great project, really love the idea behind the implementation.

    It would be great if we could only use your VueLocalStorage class in projects. The way the mixin is implemented is a bit off for our needs, but the class it's using is spot on.

    Any idea how we could do this?

    opened by tibineagu 3
  • Vue packages version mismatch

    Vue packages version mismatch

    opened by sebastiansulinski 2
  • Bump json5 and jest

    Bump json5 and jest

    Bumps json5 to 2.2.2 and updates ancestor dependency jest. These dependencies need to be updated together.

    Updates json5 from 0.5.1 to 2.2.2

    Release notes

    Sourced from json5's releases.

    v2.2.2

    • Fix: Properties with the name __proto__ are added to objects and arrays. (#199) This also fixes a prototype pollution vulnerability reported by Jonathan Gregson! (#295).

    v2.2.1

    • Fix: Removed dependence on minimist to patch CVE-2021-44906. (#266)

    v2.2.0

    • New: Accurate and documented TypeScript declarations are now included. There is no need to install @types/json5. (#236, #244)

    v2.1.3 [code, diff]

    • Fix: An out of memory bug when parsing numbers has been fixed. (#228, #229)

    v2.1.2

    • Fix: Bump minimist to v1.2.5. (#222)

    v2.1.1

    • New: package.json and package.json5 include a module property so bundlers like webpack, rollup and parcel can take advantage of the ES Module build. (#208)
    • Fix: stringify outputs \0 as \\x00 when followed by a digit. (#210)
    • Fix: Spelling mistakes have been fixed. (#196)

    v2.1.0

    • New: The index.mjs and index.min.mjs browser builds in the dist directory support ES6 modules. (#187)

    v2.0.1

    • Fix: The browser builds in the dist directory support ES5. (#182)

    v2.0.0

    • Major: JSON5 officially supports Node.js v6 and later. Support for Node.js v4 has been dropped. Since Node.js v6 supports ES5 features, the code has been rewritten in native ES5, and the dependence on Babel has been eliminated.

    • New: Support for Unicode 10 has been added.

    • New: The test framework has been migrated from Mocha to Tap.

    • New: The browser build at dist/index.js is no longer minified by default. A minified version is available at dist/index.min.js. (#181)

    • Fix: The warning has been made clearer when line and paragraph separators are used in strings.

    • Fix: package.json5 has been restored, and it is automatically generated and

    ... (truncated)

    Changelog

    Sourced from json5's changelog.

    v2.2.2 [code, diff]

    • Fix: Properties with the name __proto__ are added to objects and arrays. (#199) This also fixes a prototype pollution vulnerability reported by Jonathan Gregson! (#295).

    v2.2.1 [code, diff]

    • Fix: Removed dependence on minimist to patch CVE-2021-44906. (#266)

    v2.2.0 [code, diff]

    • New: Accurate and documented TypeScript declarations are now included. There is no need to install @types/json5. (#236, #244)

    v2.1.3 [code, diff]

    • Fix: An out of memory bug when parsing numbers has been fixed. (#228, #229)

    v2.1.2 [code, diff]

    • Fix: Bump minimist to v1.2.5. (#222)

    v2.1.1 [code, diff]

    • New: package.json and package.json5 include a module property so bundlers like webpack, rollup and parcel can take advantage of the ES Module build. (#208)
    • Fix: stringify outputs \0 as \\x00 when followed by a digit. (#210)
    • Fix: Spelling mistakes have been fixed. (#196)

    ... (truncated)

    Commits
    • 14f8cb1 2.2.2
    • 10cc7ca docs: update CHANGELOG for v2.2.2
    • 7774c10 fix: add proto to objects and arrays
    • edde30a Readme: slight tweak to intro
    • 97286f8 Improve example in readme
    • d720b4f Improve readme (e.g. explain JSON5 better!) (#291)
    • 910ce25 docs: fix spelling of Aseem
    • 2aab4dd test: require tap as t in cli tests
    • 6d42686 test: remove mocha syntax from tests
    • 4798b9d docs: update installation and usage for modules
    • Additional commits viewable in compare view

    Updates jest from 21.2.1 to 29.3.1

    Release notes

    Sourced from jest's releases.

    v29.3.1

    Fixes

    • [jest-config] Do not warn about preset in ProjectConfig #13583

    Performance

    • [jest-transform] Defer creation of cache directory #13420

    v29.3.0

    Features

    • [jest-runtime] Support WebAssembly (Wasm) imports in ESM modules (#13505)

    Fixes

    • [jest-config] Add config validation for projects option (#13565)
    • [jest-mock] Treat cjs modules as objects so they can be mocked (#13513)
    • [jest-worker] Throw an error instead of hanging when jest workers terminate unexpectedly (#13566)

    Chore & Maintenance

    • [@jest/transform] Update convert-source-map (#13509)
    • [docs] Mention toStrictEqual in UsingMatchers docs. (#13560)

    New Contributors

    Full Changelog: https://github.com/facebook/jest/compare/v29.2.2...v29.3.0

    v29.2.2

    Fixes

    • [@jest/test-sequencer] Make sure sharding does not produce empty groups (#13476)
    • [jest-circus] Test marked as todo are shown as todo when inside a focussed describe (#13504)
    • [jest-mock] Ensure mock resolved and rejected values are promises from correct realm (#13503)
    • [jest-snapshot] Don't highlight passing asymmetric property matchers in snapshot diff (#13480)

    Chore & Maintenance

    • [docs] Update link to Jest 28 upgrade guide in error message (#13483)
    • [jest-runner, jest-watcher] Update emittery (#13490)

    New Contributors

    ... (truncated)

    Changelog

    Sourced from jest's changelog.

    29.3.1

    Fixes

    • [jest-config] Do not warn about preset in ProjectConfig (#13583)

    Performance

    • [jest-transform] Defer creation of cache directory (#13420)

    29.3.0

    Features

    • [jest-runtime] Support WebAssembly (Wasm) imports in ESM modules (#13505)

    Fixes

    • [jest-config] Add config validation for projects option (#13565)
    • [jest-mock] Treat cjs modules as objects so they can be mocked (#13513)
    • [jest-worker] Throw an error instead of hanging when jest workers terminate unexpectedly (#13566)

    Chore & Maintenance

    • [@jest/transform] Update convert-source-map (#13509)
    • [docs] Mention toStrictEqual in UsingMatchers docs. (#13560)

    29.2.2

    Fixes

    • [@jest/test-sequencer] Make sure sharding does not produce empty groups (#13476)
    • [jest-circus] Test marked as todo are shown as todo when inside a focussed describe (#13504)
    • [jest-mock] Ensure mock resolved and rejected values are promises from correct realm (#13503)
    • [jest-snapshot] Don't highlight passing asymmetric property matchers in snapshot diff (#13480)

    Chore & Maintenance

    • [docs] Update link to Jest 28 upgrade guide in error message (#13483)
    • [jest-runner, jest-watcher] Update emittery (#13490)

    29.2.1

    Features

    • [@jest/globals, jest-mock] Add jest.Spied* utility types (#13440)

    Fixes

    • [jest-environment-node] make globalThis.performance writable for Node 19 and fake timers (#13467)

    ... (truncated)

    Commits
    Maintainer changes

    This version was pushed to npm by simenb, a new releaser for jest since your current version.


    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump qs from 6.4.0 to 6.4.1

    Bump qs from 6.4.0 to 6.4.1

    Bumps qs from 6.4.0 to 6.4.1.

    Changelog

    Sourced from qs's changelog.

    6.4.1

    • [Fix] parse: ignore __proto__ keys (#428)
    • [Fix] fix for an impossible situation: when the formatter is called with a non-string value
    • [Fix] use safer-buffer instead of Buffer constructor
    • [Fix] utils.merge: avoid a crash with a null target and an array source
    • [Fix] utils.merge`: avoid a crash with a null target and a truthy non-array source
    • [Fix] stringify: fix a crash with strictNullHandling and a custom filter/serializeDate (#279)
    • [Fix] utils: merge: fix crash when source is a truthy primitive & no options are provided
    • [Fix] when parseArrays is false, properly handle keys ending in []
    • [Robustness] stringify: avoid relying on a global undefined (#427)
    • [Refactor] use cached Array.isArray
    • [Refactor] stringify: Avoid arr = arr.concat(...), push to the existing instance (#269)
    • [readme] remove travis badge; add github actions/codecov badges; update URLs
    • [Docs] Clarify the need for "arrayLimit" option
    • [meta] fix README.md (#399)
    • [meta] Clean up license text so it’s properly detected as BSD-3-Clause
    • [meta] add FUNDING.yml
    • [actions] backport actions from main
    • [Tests] remove nonexistent tape option
    • [Dev Deps] backport from main
    Commits
    • 486aa46 v6.4.1
    • 727ef5d [Fix] parse: ignore __proto__ keys (#428)
    • cd1874e [Robustness] stringify: avoid relying on a global undefined (#427)
    • 45e987c [readme] remove travis badge; add github actions/codecov badges; update URLs
    • 90a3bce [meta] fix README.md (#399)
    • 9566d25 [Fix] fix for an impossible situation: when the formatter is called with a no...
    • 74227ef Clean up license text so it’s properly detected as BSD-3-Clause
    • 35dfb22 [actions] backport actions from main
    • 7d4670f [Dev Deps] backport from main
    • 0485440 [Fix] use safer-buffer instead of Buffer constructor
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump decode-uri-component from 0.2.0 to 0.2.2

    Bump decode-uri-component from 0.2.0 to 0.2.2

    Bumps decode-uri-component from 0.2.0 to 0.2.2.

    Release notes

    Sourced from decode-uri-component's releases.

    v0.2.2

    • Prevent overwriting previously decoded tokens 980e0bf

    https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.1...v0.2.2

    v0.2.1

    • Switch to GitHub workflows 76abc93
    • Fix issue where decode throws - fixes #6 746ca5d
    • Update license (#1) 486d7e2
    • Tidelift tasks a650457
    • Meta tweaks 66e1c28

    https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.0...v0.2.1

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump tmpl from 1.0.4 to 1.0.5

    Bump tmpl from 1.0.4 to 1.0.5

    Bumps tmpl from 1.0.4 to 1.0.5.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump path-parse from 1.0.5 to 1.0.7

    Bump path-parse from 1.0.5 to 1.0.7

    Bumps path-parse from 1.0.5 to 1.0.7.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
Releases(0.6.2)
  • 0.6.2(Mar 14, 2018)

  • 0.6.1(Dec 30, 2017)

  • 0.6.0(Dec 29, 2017)

    • Namespaces support (Thanks to @nikolay-borzov)
    • Docs fixes (Thanks to @thomasleveil)
    • Default types for .get method (Thanks to @nikolay-borzov for idea)
    • Usage of parseFloat instead of parseInt for Numbers (Thanks to @baryon for idea)
    • Little code cleanup
    Source code(tar.gz)
    Source code(zip)
  • v0.5.0(Oct 17, 2017)

    Thanks a lot for @dasdeck for great PR.

    Now you can bind properties as computed to call them like this:

    Vue.use(localStorage, { bind: true })
    
    new Vue({
      localStorage: {
        someValue: {
          default: 6,
          type: Number
        }
      },
      created () {
        this.someValue // 6
        this.somValue = 7 // Will write 7 to localStorage
      }
    })
    

    You can use global config bind property like:

    Vue.use(localStorage, { bind: true })
    

    or use it for properties you need to be bounded as computed:

    new Vue({
      localStorage: {
        someValue: {
          type: Number,
          bind: true
        }
      }
    })
    
    Source code(tar.gz)
    Source code(zip)
  • 0.4.2(Sep 18, 2017)

  • 0.4.1(Aug 20, 2017)

    • Server Side Rendering is supported now with all Nuxt releases and also tested with VueHackerNews which uses Vue 2 SSR (Thanks to @wilk for the issue)
    • Module names and author info fixed (Thanks to @zaplachinsky for the PR)
    Source code(tar.gz)
    Source code(zip)
  • 0.3.0(Jun 24, 2017)

  • 0.2.0(May 7, 2017)

    • All code covered with unit tests (Jest used)
    • Added build scripts with rollup
    • Dist and src folders are splitted now
    • Value fallback for get method (see README)
    Source code(tar.gz)
    Source code(zip)
  • v0.1.2(Nov 5, 2016)

Owner
Alexander Avakov
Alexander Avakov
A script and resource loader for caching & loading files with localStorage

Basket.js is a script and resource loader for caching and loading scripts using localStorage ##Introduction for the Non-Developer Modern web applicati

Addy Osmani 3.4k Dec 30, 2022
localStorage and sessionStorage done right for AngularJS.

ngStorage An AngularJS module that makes Web Storage working in the Angular Way. Contains two services: $localStorage and $sessionStorage. Differences

G. Kay Lee 2.3k Nov 26, 2022
💾 Offline storage, improved. Wraps IndexedDB, WebSQL, or localStorage using a simple but powerful API.

localForage localForage is a fast and simple storage library for JavaScript. localForage improves the offline experience of your web app by using asyn

localForage 21.5k Jan 1, 2023
:lock: Secure localStorage data with high level of encryption and data compression

secure-ls Secure localStorage data with high level of encryption and data compression. LIVE DEMO Features Secure data with various types of encryption

Varun Malhotra 602 Nov 30, 2022
Expirable data storage based on localStorage and sessionStorage.

Expirable storage About The Project Expirable data storage based on localStorage and sessionStorage. Getting Started To get a local copy up and runnin

Wayfair Tech – Incubator 5 Oct 31, 2022
Simple window.localStorage, with type safety

mini-local-storage simple window.localStorage, with type safety example // localStorage.ts import { createLocalStorage } from "mini-local-storage";

Kipras Melnikovas 4 Jan 8, 2023
Browser storage interface for IndexedDB, WebSQL, LocalStorage, and in memory data with Schema and data validator.

Client Web Storage Browser storage interface for IndexedDB, WebSQL, LocalStorage, and in memory data with basic Schema and data validation. Installati

Before Semicolon 19 Sep 30, 2022
A Vue.js plugin for manipulating cookies

vue-cookie A Vue.js plugin for manipulating cookies tested up to Vue v2.0.5 Installation Install through npm npm install vue-cookie --save Include in

Alf 819 Dec 8, 2022
local storage wrapper for both react-native and browser. Support size controlling, auto expiring, remote data auto syncing and getting batch data in one query.

react-native-storage This is a local storage wrapper for both react native apps (using AsyncStorage) and web apps (using localStorage). ES6 syntax, pr

Sunny Luo 2.9k Dec 16, 2022
A enhanced web storage with env support, expire time control, change callback and LRU storage clear strategy.

enhanced-web-storage A enhanced web storage with env support, expire time control, change callback and LRU storage clear strategy. How to Start import

Ziwen Mei 15 Sep 10, 2021
Collection of storages for session plugin of grammY.

Grammy storages This is monorepo for Satont's adapters for grammY Storages file mongodb psql redis typeorm Each package is 100% TypeScript, well teste

null 21 Jan 5, 2023
Types generator will help user to create TS types from JSON. Just paste your single object JSON the Types generator will auto-generate the interfaces for you. You can give a name for the root object

Types generator Types generator is a utility tool that will help User to create TS Interfaces from JSON. All you have to do is paste your single objec

Vineeth.TR 16 Dec 6, 2022
Satyam Sharma 3 Jul 8, 2022
基于vue3.0-ts-Element集成的简洁/实用后台模板!《带预览地址》vue-admin;vue+admin;vue-element;vue+element;vue后台管理;vue3.0-admin;vue3.0-element。

一、基于vue3.0+ts+Element通用后台admin模板 二、在线预览地址:http://admin.yknba.cn/ 三、下载使用: 1、克隆代码 通过git将代码克隆到本地;或者使用下载安装包模式进行下载。 2、进入目录 进入项目的根目录:vue3.0-ts-admin 3、安装依

null 64 Dec 16, 2022
Express typescript boilerplate using @types/node, @types/express

Express framework boilerplate in typescript.

Harris Gurung 3 Sep 21, 2022
Compile-time tests for types. Useful to make sure types don't regress into being overly-permissive as changes go in over time.

expect-type Compile-time tests for types. Useful to make sure types don't regress into being overly-permissive as changes go in over time. Similar to

Misha Kaletsky 82 Jan 8, 2023
Query for CSS brower support data, combined from caniuse and MDN, including version support started and global support percentages.

css-browser-support Query for CSS browser support data, combined from caniuse and MDN, including version support started and global support percentage

Stephanie Eckles 65 Nov 2, 2022
Gmail-like client-side drafts and bit more. Plugin developed to save html forms data to LocalStorage to restore them after browser crashes, tabs closings and other disasters.

Sisyphus Plugin developed to save html forms data to LocalStorage to restore them after browser crashes, tabs closings and other disasters. Descriptio

Alexander Kaupanin 2k Dec 8, 2022
A plugin that can help you create project friendly with Vue for @vue/cli 4.5

vue-cli-plugin-patch A plugin that can help you create project friendly with Vue for @vue/cli 4.5. Install First you need to install @vue/cli globally

null 2 Jan 6, 2022
Basic types & utilities for Strapi v4 and plugin creators

Strapi v4 - Types & utilities Basic set of types and utilities for Strapi v4 and plugins creators A developers goodie for Strapi Headless CMS which pr

 VirtusLab Open-Source 7 Oct 14, 2022