npm package: @sofiakb/cookie
Description: Package description.
Author: Sofiakb
Latest version: 1.0.0-beta.8

[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]

[comment]: <> ([![LinkedIn][linkedin-shield]][linkedin-url])



<!-- PROJECT LOGO -->
<br />
<p align="center">

  <h1 align="center">cookie</h1>

  <p align="center">
      <!--A PHP Library for detect OS System !-->
      <br />
      <!--<a href="https://github.com/sofiakb/cookie"><strong>Explore the docs »</strong></a>-->
      <br />
      <br />
      <a href="https://github.com/sofiakb/cookie/issues">Report Bug</a>
      ·
      <a href="https://github.com/sofiakb/cookie/issues">Request Feature</a>
  </p>

</p>



<!-- TABLE OF CONTENTS -->
<details open="open">
  <summary>Table of Contents</summary>
  <ol>
    <li>
      <a href="#about-the-project">About the library</a>
      <ul>
        <li><a href="#built-with">Built With</a></li>
      </ul>
    </li>
    <li>
      <a href="#getting-started">Getting Started</a>
      <ul>
        <li><a href="#prerequisites">Prerequisites</a></li>
        <li><a href="#installation">Installation</a></li>
      </ul>
    </li>
    <li><a href="#usage">Usage</a></li>
    <li><a href="#roadmap">Roadmap</a></li>
    <li><a href="#contributing">Contributing</a></li>
    <li><a href="#license">License</a></li>
    <li><a href="#contact">Contact</a></li>
    <li><a href="#acknowledgements">Acknowledgements</a></li>
  </ol>
</details>



<!-- ABOUT THE PROJECT -->

## About The Library

[comment]: <> (The library allows to detect os system in PHP project.)

### Built With

This section should list any major frameworks that you built your project using. Leave any add-ons/plugins for the
acknowledgements section. Here are a few examples.

* [Javascript](https://developer.mozilla.org/fr/docs/Web/JavaScript)
* [Adonis.js](https://adonisjs.com/)
* [Node.js](https://nodejs.org/en/)

<!-- GETTING STARTED -->

### Prerequisites

### Installation

```shell
npm install --save @sofiakb/cookie
```

<!-- USAGE EXAMPLES -->

## Usage

### cookie.set(string key, var value[, object options])
Set cookie with specified key and value with options. value can be a object.
Available options are:
- expires: Days of expiration.
- days: Alias of expires.
- path: Path of cookie.
- domain: Domain of cookie.
- secure: HTTPS only.

```javascript
import cookie from 'json-cookie';

cookie.set('test', 'test');		// test=test
cookie.set('json-test', { name: '.modernator' });    // json-test={"name":".modernator"}

cookie.set('ex-test', 'test', {
	expires: 1
});		// ex-test=test; expires= ...
```


### cookie.get(string key)
Get cookie with key. If cookie isn't exist, it returns undefined.

```javascript
import cookie from 'json-cookie';

cookie.get('test');		// test
cookie.get('json-test');	// Object { name: '.modernator' }

```


### cookie.delete(string key)
Delete cookie with key.

```javascript
import cookie from 'json-cookie';

cookie.delete('test');
cookie.get('test');		//
```

<!-- ROADMAP -->

## Roadmap

See the [open issues](https://github.com/sofiakb/cookie/issues) for a list of proposed features (and known issues).


<!-- LICENSE -->

## License

Distributed under the MIT License. See `LICENSE` for more information.




<!-- MARKDOWN LINKS & IMAGES -->
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->

[contributors-shield]: https://img.shields.io/github/contributors/sofiakb/cookie.svg?style=for-the-badge

[contributors-url]: https://github.com/sofiakb/cookie/graphs/contributors

[forks-shield]: https://img.shields.io/github/forks/sofiakb/cookie.svg?style=for-the-badge

[forks-url]: https://github.com/sofiakb/cookie/network/members

[stars-shield]: https://img.shields.io/github/stars/sofiakb/cookie.svg?style=for-the-badge

[stars-url]: https://github.com/sofiakb/cookie/stargazers

[issues-shield]: https://img.shields.io/github/issues/sofiakb/cookie.svg?style=for-the-badge

[issues-url]: https://github.com/sofiakb/cookie/issues

[license-shield]: https://img.shields.io/github/license/sofiakb/cookie.svg?style=for-the-badge

[license-url]: https://github.com/sofiakb/cookie/blob/main/LICENSE

[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555

[linkedin-url]: https://www.linkedin.com/in/sofiane-akbly/