0.0.5 ā€¢ Published 2 years ago

@beeeku/cookieplus v0.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Nicer way to manage your cookies

Install

npm install @beeeku/cookieplus
yarn add @beeeku/cookieplus

Importing library

import { getCookie, setCookie, removeCookie, clearCookie } from '@beeeku/cookieplus';

Usage

const times = parseInt(getCookie('times'), 10) || 0;
setCookie('times', times + 1);
removeCookie('times');
clearCookie();

Demo

CodeSandbox

API

getCookie(key)

Return the cookie value for key.

setCookie(key, value, opts={})

Set the cookie at key to value with optional parameters expires and path.`.

removeCookie(key)

Removes cookie value stored at key.`.

clearCookie()

Removes all currently available cookies.

Author

šŸ‘¤ Bikash Dash

Show your support

Give a ā­ļø if this project helped you!