Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/awibox/combo-storage
The package allows you to manage data in LocalStorage, SessionStorage and Cookies
https://github.com/awibox/combo-storage
cookie-methods cookie-session cookies localstorage npm-package sessionstorage
Last synced: 5 days ago
JSON representation
The package allows you to manage data in LocalStorage, SessionStorage and Cookies
- Host: GitHub
- URL: https://github.com/awibox/combo-storage
- Owner: awibox
- License: mit
- Created: 2019-12-17T18:14:02.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-12-18T16:42:41.000Z (11 months ago)
- Last Synced: 2024-04-26T20:49:16.737Z (6 months ago)
- Topics: cookie-methods, cookie-session, cookies, localstorage, npm-package, sessionstorage
- Language: JavaScript
- Homepage:
- Size: 993 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
![combo-storage](https://repository-images.githubusercontent.com/228675568/0c2f3900-2426-11ea-91c3-ce97fdf2164c)
[![Version](https://img.shields.io/npm/v/combo-storage)](https://www.npmjs.com/package/combo-storage)
[![Build](https://img.shields.io/github/workflow/status/awibox/combo-storage/Release)](https://github.com/awibox/combo-storage/actions)
[![Coverage](https://coveralls.io/repos/github/awibox/combo-storage/badge.svg?branch=master)](https://coveralls.io/github/awibox/combo-storage?branch=master)
[![Minified size](https://img.shields.io/bundlephobia/min/combo-storage)](https://github.com/awibox/combo-storage/blob/master/LICENSE)
[![Downloads](https://img.shields.io/npm/dm/combo-storage)](https://www.npmjs.com/package/combo-storage)
[![Tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://github.com/facebook/jest)## Table of contents
* [Installation](#installation)
* [Getting started](#gettingstarted)
* [Methods for LocalStorage and SessionStorage](#basemetnods)
* [Cookie methods](#cookie)
* [Contributing](#contributing)
## Installation
You need to install package.
```bash
npm install combo-storage
```
## Getting started
You should import the required storage to use the package
```js
import { LocalStorage, SeessionStorage, Cookie } from 'combo-storage'
```
Then use the methods of storage. For example:
```js
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](/.github/CONTRIBUTING.md).