1.0.0 ā€¢ Published 8 months ago

simple-react-cookie v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

Simple React Cookie

šŸŖ A simple and lightweight package for handling cookies in React.js applications.

Installation šŸš€

You can install the package via npm:

npm install simple-react-cookie

Usage šŸ“–

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

Importing the Package šŸ“„

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

Setting a Cookie

// Syntax: setCookie(name, value, options)
setCookie('username', 'JohnDoe', { expires: 30, path: '/' });
//expires is in day format

Getting a cookie

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

Removing a cookie

// 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

1.0.0

8 months ago