# simple-react-cookie

> A React.js library for handling cookies simply and easily.

Latest version **1.0.0** (published 2023-09-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install simple-react-cookie
pnpm add simple-react-cookie
yarn add simple-react-cookie
bun add simple-react-cookie
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2023-09-25 |
| First published | 2023-09-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Oktay Kopcak |
| Maintainers | oktay.dev |
| Keywords | react, cookie, cookies |

## Links

- npm: https://www.npmjs.com/package/simple-react-cookie
- Repository: https://github.com/oktayla/simple-react-cookie
- Homepage: https://github.com/oktayla/simple-react-cookie#readme
- Issues: https://github.com/oktayla/simple-react-cookie/issues
- npm.io page: https://npm.io/package/simple-react-cookie

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2023-09-25

## README

# Simple React Cookie

🍪 A simple and lightweight package for handling cookies in React.js applications.

## Installation 🚀

You can install the package via npm:

```bash
npm install simple-react-cookie
```

## Usage 📖
Here's how you can use the react-cookie package in your React.js application:

## Importing the Package 📥

```js
import React from 'react';
import { setCookie, getCookie, removeCookie } from 'simple-react-cookie';
```

## Setting a Cookie
```js
// Syntax: setCookie(name, value, options)
setCookie('username', 'JohnDoe', { expires: 30, path: '/' });
//expires is in day format
```

## Getting a cookie
```js
// Syntax: getCookie(name)
const username = getCookie('username');
console.log(`Username: ${username}`);
```

## Removing a cookie
```js
// Syntax: removeCookie(name)
removeCookie('username');
```

## License
This package is open-source and available under the MIT License. Feel free to use, modify, and distribute it according to the terms of the license.

## Issues and Contributions
If you encounter any issues or have suggestions for improvement, please create an issue on the GitHub repository.

Contributions are welcome! If you'd like to contribute to the development of this package, please fork the repository and submit a pull request.

## Author
Oktay Kopcak

---
_Source: https://npm.io/package/simple-react-cookie · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
