@beeeku/cookieplus
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

Welcome to cookieplus 👋

Version License: MIT Twitter: beeeku

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!

Readme

Keywords

none

Package Sidebar

Install

npm i @beeeku/cookieplus

Weekly Downloads

1

Version

0.0.5

License

MIT

Unpacked Size

10.3 kB

Total Files

10

Last publish

Collaborators

  • beeeku