👋
Welcome to cookieplus
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
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
- Website: https://bika.sh
- Twitter: @beeeku
- Github: @beeeku
- LinkedIn: @beeeku
Show your support
Give a