@headbright/hb-universal-storage

1.0.1 • Public • Published

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)
}

Readme

Keywords

none

Package Sidebar

Install

npm i @headbright/hb-universal-storage

Weekly Downloads

28

Version

1.0.1

License

BSD-3

Unpacked Size

26.2 kB

Total Files

6

Last publish

Collaborators

  • kkonstantin