Skip to content

README: fix docs around parse() / stringify() function names#255

Merged
blakeembrey merged 3 commits intojshttp:masterfrom
getify:patch-1
Feb 13, 2026
Merged

README: fix docs around parse() / stringify() function names#255
blakeembrey merged 3 commits intojshttp:masterfrom
getify:patch-1

Conversation

@getify
Copy link
Contributor

@getify getify commented Dec 28, 2025

One fix here is an inconsistency where stringify() in code example hadn't been updated to the new stringifyCookie() name of the section the example was in.

The other fix is adding a note to each section (parseCookie() and stringifyCookie()) to indicate their now-deprecated alias names.

README.md Outdated

### cookie.parseCookie(str, options)

Alias: `parse()` (deprecated)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you share more context around adding the deprecated names? I can guess it’s for quick lookup from a previous version, but would like to understand more.

WDYT about making a “deprecated” section at the bottom and using that instead to point to the new methods? It could contain more information about the old function format too (three args vs one for stringify).

Copy link
Contributor Author

@getify getify Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I upgraded from version 1.0.2 to 1.1.1, and as I was checking the docs, was confused by the new names... it felt at first like it had been a breaking change, even though it was only a minor version update.

I didn't see that the old names were still there for several minutes (where I was searching through the commit history to find out when that "breaking change" had happened), and then found the aliases were included down at the bottom of the file.

So my goal in adding them to the documentation is to prevent others' confusion. I made the "assumption" of deprecation given the name change but if there's no intent to actually deprecate, that part could be taken out from the names.

If you're intending to deprecate (and eventually break, on a semver major) the arguments, I agree those changes should also be noted in the docs, and indeed maybe a "Deprecation" section is appropriate.

But even still, I think to prevent confusion for others, like I had, I think having some note like my "Alias: .." in each section is helpful (at least for the rest of the 1.x branch) so people upgrading can see that they used to call parse() and can still do so, but should update to the parseCookie() name, or whatever).

If you have other thoughts on how best to document, I'm happy to update the PR... or you can do so. Either way, was just trying to help others not hit my confusion. :)

@codecov
Copy link

codecov bot commented Feb 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (4898ba2) to head (084d801).
⚠️ Report is 22 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #255   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines          160       253   +93     
  Branches        69       113   +44     
=========================================
+ Hits           160       253   +93     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

README.md Outdated

### cookie.stringifyCookie(cookieObj, options)

Alias: `stringify()` (deprecated)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed to move this, it was serialize and the new method is stringifySetCookie (common mistake and why it was renamed when there's now two different stringify methods).

http.createServer(onRequest).listen(3000);
```

## Deprecated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a lightweight deprecated section and linked it, there's not a lot to include but it can be expanded in the future.

@blakeembrey blakeembrey merged commit 007cbde into jshttp:master Feb 13, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants