From 37cfaea1a89127139d11514df256f408921a83a3 Mon Sep 17 00:00:00 2001 From: Kyle Simpson Date: Sun, 28 Dec 2025 17:29:32 -0600 Subject: [PATCH 1/3] README: fix rename of stringify() to stringifyCookie() --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 24ec013..f8af3e3 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ const cookieObject = cookie.parseCookie("foo=bar; equation=E%3Dmc%5E2"); Stringifies a [cookie object](#cookie-object) into an HTTP `Cookie` header. ```js -const cookieHeader = cookie.stringify({ a: "foo", b: "bar" }); +const cookieHeader = cookie.stringifyCookie({ a: "foo", b: "bar" }); // a=foo; b=bar ``` From dffa4506c3f13b2da0e96617566bfcab59810028 Mon Sep 17 00:00:00 2001 From: Kyle Simpson Date: Sun, 28 Dec 2025 17:34:46 -0600 Subject: [PATCH 2/3] adding notes about deprecated aliases Added deprecation notices for parse() and stringify() aliases. --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index f8af3e3..73e53df 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,8 @@ const cookie = require("cookie"); ### cookie.parseCookie(str, options) +Alias: `parse()` (deprecated) + Parse an HTTP `Cookie` header string and return an [object](#cookie-object) of all cookie name-value pairs. The `str` argument is the string representing a `Cookie` header value and `options` is an optional object containing additional parsing options. @@ -37,6 +39,8 @@ const cookieObject = cookie.parseCookie("foo=bar; equation=E%3Dmc%5E2"); ### cookie.stringifyCookie(cookieObj, options) +Alias: `stringify()` (deprecated) + Stringifies a [cookie object](#cookie-object) into an HTTP `Cookie` header. ```js From 084d801e8f8b1822aee8700cc547aa887a257c5d Mon Sep 17 00:00:00 2001 From: Blake Embrey Date: Fri, 13 Feb 2026 13:42:35 -0800 Subject: [PATCH 3/3] Add deprecated section --- README.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 73e53df..09cb444 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ const cookie = require("cookie"); ### cookie.parseCookie(str, options) -Alias: `parse()` (deprecated) +Alias: `parse(str, options)` ([deprecated](#deprecated)) Parse an HTTP `Cookie` header string and return an [object](#cookie-object) of all cookie name-value pairs. The `str` argument is the string representing a `Cookie` header value and `options` is an @@ -39,8 +39,6 @@ const cookieObject = cookie.parseCookie("foo=bar; equation=E%3Dmc%5E2"); ### cookie.stringifyCookie(cookieObj, options) -Alias: `stringify()` (deprecated) - Stringifies a [cookie object](#cookie-object) into an HTTP `Cookie` header. ```js @@ -76,6 +74,8 @@ cookie.parseSetCookie( ### cookie.stringifySetCookie(setCookieObj, options) +Alias: `serialize(str, val, options)` ([deprecated](#deprecated)) + Stringifies a [`Set-Cookie` object](#set-cookie-object) into a `Set-Cookie` header string. ```js @@ -242,6 +242,14 @@ function onRequest(req, res) { http.createServer(onRequest).listen(3000); ``` +## Deprecated + +These APIs will be removed in the future: + +- `parse` - use new `parseCookie` name +- `stringify` - use new `stringifySetCookie` name +- `stringify(str, val, opts)` - use `stringifySetCookie(obj, opts)` + ## Testing ```sh