Security News
CISA Brings KEV Data to GitHub
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
cookie-muncher
Advanced tools
A lightweight and typesafe package for manipulating cookies in Node.js and the browser.
You can install Cookie Muncher via NPM, Yarn or PNPM.
npm install cookie-muncher
yarn add cookie-muncher
pnpm install cookie-muncher
serializeCookie(cookie: Cookie, options?: CookieOptions): string
Serialize a cookie into a string.
import type { Cookie, CookieOptions } from "cookie-muncher";
import { serializeCookie, CookieMaxAge } from "cookie-muncher";
const cookie: Cookie = {
name: "myCookie",
value: "myValue",
};
const options: CookieOptions = {
maxAge: CookieMaxAge.TwoWeeks,
path: "/",
secure: true,
sameSite: "Strict",
};
const serializedCookie = serializeCookie(cookie, options);
console.log(serializedCookie);
// "myCookie=myValue; Max-Age=3600; Path=/; Secure; SameSite=Strict"
parseCookies(cookies: string): Cookie[]
Parse a string of cookies into an array of cookie objects.
import { parseCookies } from "cookie-muncher";
const cookies = "myCookie1=myValue1; myCookie2=myValue2";
const parsedCookies = parseCookies(cookies);
console.log(parsedCookies);
// [{ name: "myCookie1", value: "myValue1" }, { name: "myCookie2", value: "myValue2" }]
This package is MIT licensed.
FAQs
Effortless cookie management for server and browser
The npm package cookie-muncher receives a total of 135 weekly downloads. As such, cookie-muncher popularity was classified as not popular.
We found that cookie-muncher demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.