Skip to content

Conversation

@nfriedly
Copy link
Owner

@nfriedly nfriedly commented Dec 17, 2025

This has a few big changes all rolled into one:

  • Converted the library to ESM and added a script to automatically build a CJS version on pre-commit.
    • I think I got everything right in package.json to make it work in either type of project.
  • splitCookieString() is now called automatically when appropriate, with a new split option to override the behavior
  • The documented API is now a single named export: parseSetCookie(input, options)
    • but all previous API methods/names remain present for backwards compatibility - in both the CJS and ESM versions

I think this will be a non-breaking change for most, if not all, users. But I'm not 100% sure and I had previously stated that the automatic splitCookieString() would be in a major version, so calling this 3.0 feels like the right move.

@bytesnz, @thib3113, @realityking, @benmccann, @renatoaraujoc, & @LenweSaralonde would you each mind giving this a shot sometime in the next week or two? (Or let me know if you need more time than that.)

You can install this branch in your local project with this command:

npm install git+https://github.com/nfriedly/set-cookie-parser#v3

Fixes #73
Fixes #50
Relates to #68

Copy link
Owner Author

Choose a reason for hiding this comment

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

This is just a copy of of lib/set-cookie.js, but with the exports at then end changed to cjs.

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.

Incorrectly parsed cookie distribute ESM version

2 participants