[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,…


This content originally appeared on DEV Community and was authored by Bluzzi

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

Feel free to drop a ⭐ on the GitHub repo or contribute! 😀


This content originally appeared on DEV Community and was authored by Bluzzi


Print Share Comment Cite Upload Translate Updates
APA

Bluzzi | Sciencx (2023-04-27T03:14:36+00:00) [JS/TS] Cookie Muncher – Effortless cookie management. Retrieved from https://www.scien.cx/2023/04/27/js-ts-cookie-muncher-effortless-cookie-management/

MLA
" » [JS/TS] Cookie Muncher – Effortless cookie management." Bluzzi | Sciencx - Thursday April 27, 2023, https://www.scien.cx/2023/04/27/js-ts-cookie-muncher-effortless-cookie-management/
HARVARD
Bluzzi | Sciencx Thursday April 27, 2023 » [JS/TS] Cookie Muncher – Effortless cookie management., viewed ,<https://www.scien.cx/2023/04/27/js-ts-cookie-muncher-effortless-cookie-management/>
VANCOUVER
Bluzzi | Sciencx - » [JS/TS] Cookie Muncher – Effortless cookie management. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2023/04/27/js-ts-cookie-muncher-effortless-cookie-management/
CHICAGO
" » [JS/TS] Cookie Muncher – Effortless cookie management." Bluzzi | Sciencx - Accessed . https://www.scien.cx/2023/04/27/js-ts-cookie-muncher-effortless-cookie-management/
IEEE
" » [JS/TS] Cookie Muncher – Effortless cookie management." Bluzzi | Sciencx [Online]. Available: https://www.scien.cx/2023/04/27/js-ts-cookie-muncher-effortless-cookie-management/. [Accessed: ]
rf:citation
» [JS/TS] Cookie Muncher – Effortless cookie management | Bluzzi | Sciencx | https://www.scien.cx/2023/04/27/js-ts-cookie-muncher-effortless-cookie-management/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.