nuxt-universal-storage

Universal Storage Utilities for Nuxt.js

Please migrate to `@nuxtjs/universal-storage` (https://git.io/fjPw7)
Last updated 2 years ago by kevinmarrec .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install nuxt-universal-storage 
SYNC missed versions from official npm registry.

Nuxt Universal Storage Module

npm (scoped with tag) npm CircleCI Codecov Dependencies js-standard-style

Universal Storage Utilities for Nuxt.js based on @nuxt-community/auth-module

???? Release Notes

Setup

  • Add nuxt-universal-storage dependency using yarn or npm to your project
yarn add nuxt-universal-storage

OR

npm install nuxt-universal-storage --save
  • Add nuxt-universal-storage to modules section of nuxt.config.js
{
  modules: [
    'nuxt-universal-storage',
  ],

  storage: {

  }
}

Usage

Options

Options are defined as following:

 storage: {
  vuex, // boolean or {namespace} 
  localStorage, // boolean or {prefix } 
  cookie, // boolean or {prefix, options } 
  initialState,  // Object {}
  ignoreExceptions // 
 }

and default to

 {
  vuex: {
    namespace: 'storage'
  },
  cookie: {
    prefix: '',
    options: {
      path: '/'
    }
  },
  localStorage: {
    prefix: ''
  },
  ignoreExceptions: false,
}

Api

  • $storage.getUniversal(key)
  • $storage.setUniversal(key, value)
  • $storage.syncUniversal(key, defaultValue)
  • $storage.removeUniversal(key)
  • $storage.getState(key)
  • $storage.setState(key, value)
  • $storage.removeState(key)
  • $storage.watchState(key, fn)
  • $storage.getLocalStorage(key)
  • $storage.setLocalStorage(key, value)
  • $storage.removeLocalStorage(key)
  • $storage.getCookies()
  • $storage.getCookie(key)
  • $storage.setCookie(key, value)
  • $storage.removeCookie(key)

Development

  • Clone this repository
  • Install dependencies using yarn install or npm install
  • Start development server using yarn run dev or npm run dev
  • Point your browser to http://localhost:3000

Roadmap

  • Add Encryption
  • Complete Documents
  • Universal Session Handling

License

MIT License - Alibaba Travels Co

Current Tags

  • 0.3.1                                ...           latest (2 years ago)

9 Versions

  • 0.3.1 [deprecated]           ...           2 years ago
  • 0.3.0 [deprecated]           ...           2 years ago
  • 0.2.1 [deprecated]           ...           2 years ago
  • 0.2.0 [deprecated]           ...           2 years ago
  • 0.1.4 [deprecated]           ...           2 years ago
  • 0.1.3 [deprecated]           ...           2 years ago
  • 0.1.2 [deprecated]           ...           3 years ago
  • 0.1.1 [deprecated]           ...           3 years ago
  • 0.0.1 [deprecated]           ...           3 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 3
Dependencies (4)
Dev Dependencies (14)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |