npm / cookie
cookie
What changed in cookie 1 to 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-25.
9 breaking5 new APIs and options3 performance1 behavior and defaults1 tooling4 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initcookie 28 changes
Breaking changes 3
The package is ESM-only; Node versions older than 22 are not supported.
The old
parsemethod is renamed toparseCookie.The old
stringifymethod is renamed tostringifySetCookie, which only supports object mode.
Performance 3
Parsing set-cookie is slightly faster because the parser increments the = index.
Encoding performance is optimized.
Stringifying cookies is faster.
Fixes and other changes 2
The
encodefunction is now applied to empty cookie values.Fixes an unwanted leading semicolon when stringifying cookies with skipped values.
cookie 115 changes
Breaking changes 6
The package adds an __esModule marker, so imports must use named imports or namespace imports.
The minimum supported Node.js version is now v18.
The object returned by parse now has a null prototype.
Priority values must use lowercase spelling.
The strict value must use lowercase spelling.
maxAge must be an integer; non-integer values are checked with Number.isInteger.
New APIs and options 5
Renames parse to parseCookie for clarity; the old method name remains for backward compatibility.
Adds parseSetCookie for parsing Set-Cookie values.
Adds a side effects field.
Adds stringifyCookie for stringifying cookies.
Renames serialize to stringifySetCookie for clarity; the old method name remains for backward compatibility.
Behavior and default changes 1
The decode option now defines error handling and quote parsing.
Tooling 1
The package now ships TypeScript definitions.
Fixes and other changes 2
When
valueis provided in the options object,serializenow uses the value passed as an argument instead.Argument and option error messages have been improved.