[JS/TS] Cookie Muncher - Effortless cookie management

bluzzi

Bluzzi

Posted on April 27, 2023

[JS/TS] Cookie Muncher - Effortless cookie management

When we create a website, we always need to use cookies, either on the browser side, or on the server side through the HTTP headers Cookie and Set-Cookie.

The problem is that most of the packages allowing to handle cookies are not maintained anymore, not written in TS, not exported in both CommonJS and ES module, not 100% compliant with RFC 6265, not complete enough and usable on both server and client side or simply don't have a good API...

That's why I created my own package : Cookie Muncher! A lightweight and typesafe package for manipulating cookies in NodeJS and the browser.

  • ๐Ÿš€ Lightweight
  • ๐ŸŒ Works in all browsers
  • ๐Ÿงช Unit tested
  • ๐Ÿ”ท Typesafe
  • ๐Ÿ“ฆ Support ESM & CJS
  • โœ… RFC 6265 compliant
  • ๐Ÿ“– Well documented

This package is divided into two modules.

httpCookie

Serialize and parse cookie from HTTP headers Cookie and Set-Cookie.

domCookie

Create, update, remove and get cookies from browser DOM.

This package will definitely be your best friend the next time you need to use cookies! ๐Ÿช

# NPM
npm install cookie-muncher

# YARN
yarn add cookie-muncher

# PNPM
pnpm install cshookie-muncher
Enter fullscreen mode Exit fullscreen mode

Feel free to drop a โญ on the GitHub repo or contribute! ๐Ÿ˜€

๐Ÿ’– ๐Ÿ’ช ๐Ÿ™… ๐Ÿšฉ
bluzzi
Bluzzi

Posted on April 27, 2023

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

ยฉ TheLazy.dev

About