1.0.1 • Published 4 years ago

@headbright/hb-universal-storage v1.0.1

Weekly downloads
2
License
BSD-3
Repository
github
Last release
4 years ago

Universal Storage Helper

Universal storage helper for Nuxt projects with tweaks to facilitate use with older browsers.

The project is based on the equivalent nuxt community module.

Installation

  1. npm i --save @headbright/hb-universal-storage

  2. Create a nuxt plugin:

import Storage from 'hb-universal-storage'

export default function(ctx, inject) {
  const options = {
    vuex: {
      namespace: 'storage'
    },
    cookie: {
      prefix: '',
      options: {
        path: '/'
      }
    },
    localStorage: {
      prefix: ''
    },
    ignoreExceptions: false
  }
  const storage = new Storage(ctx, options)
  ctx.$storage = storage
  inject('storage', storage)
}
1.0.1

4 years ago

1.0.0

4 years ago