set-cookie-parser icon indicating copy to clipboard operation
set-cookie-parser copied to clipboard

V3: ESM+CJS, automatic split combined cookies, & general API cleanup

Open nfriedly opened this issue 2 months ago • 0 comments

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
    • 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? 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 https://github.com/nfriedly/set-cookie-parser/discussions/68

nfriedly avatar Dec 17 '25 23:12 nfriedly