combo-storage

2.1.2 • Public • Published

combo-storage

Version Build Coverage Minified size Downloads Tested with jest

Table of contents

Installation

You need to install package.

npm install combo-storage

Getting started

You should import the required storage to use the package

import { LocalStorage, SeessionStorage, Cookie } from 'combo-storage'

Then use the methods of storage. For example:

LocalStorage.set('user', 'awibox');

Base methods for LocalStorage and SessionStorage

Method LocalStorage SessionStorage
set LocalStorage.set(key, value) SessionStorage.set(key, value)
get LocalStorage.get(key) SessionStorage.get(key)
remove LocalStorage.remove(key) SessionStorage.remove(key)
сlear LocalStorage.clear() SessionStorage.clear()

Note: get and set methods are available for working with objects and arrays.

Cookie methods

Method Example
set Cookie.set(name, value, days);
get Cookie.get(name)
remove Cookie.remove(name)

Contributing

Please read through our CONTRIBUTING.md.

Package Sidebar

Install

npm i combo-storage

Weekly Downloads

298

Version

2.1.2

License

MIT

Unpacked Size

24.7 kB

Total Files

24

Last publish

Collaborators

  • awibox