1.2.2 • Published 5 years ago

nuxt-storage v1.2.2

Weekly downloads
489
License
MIT
Repository
github
Last release
5 years ago

🛢 Nuxt-Storage

License version downloads Travis codecov Dependencies

Utilities for easy read and write browser's storage in Nuxt.js project

Why I need this package?

In Nuxt, it's hard to play with browser's storage like sessionStorage and localStorage. This package will help you handle client side storage with a simple API and with various useful additional features such as expiry.

How to install and use

Install using NPM or Yarn

# NPM
$ npm i nuxt-storage
# Yarn
$ yarn add nuxt-storage

Sample using this package

All API import

import nuxtStorage from 'nuxt-storage';

nuxtStorage.localStorage.setData('key', 'value');
nuxtStorage.sessionStorage.setData('key', 'value');

Partial import

// # for local storage
import { getData, setData } from 'nuxt-storage/local-storage';

// # for session storage
// import { getData, setData } from 'nuxt-storage/session-storage';

setData('key', 'value');

API

Method NameParameterDefault ValueAvailable Options
getDatakey (type: String)Empty String
setDatakey (type: String)Empty String
value (type: any)Empty String
expiry (type: Number)5
expiryUnit (type: String)ms = second, m = minutes, h = hour, d = day
clear-

Copyright © 2018 by Irfan Maulana

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.0

5 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago