{"library":"set-cookie-parser-es","title":"ESM Set-Cookie Header Parser","description":"set-cookie-parser-es is an actively maintained, ESM-first JavaScript library, currently at version 1.0.5, designed for parsing `Set-Cookie` HTTP headers. It serves as an ECMAScript Module (ESM) port of the popular `set-cookie-parser` package, offering bundled TypeScript types for an enhanced developer experience. Unlike its predecessor, this library distinguishes itself by being entirely framework and runtime agnostic; it specifically does *not* accept Node.js response objects, focusing purely on string-based header parsing. Its `splitCookiesString` utility also strictly operates on a single `set-cookie` header string, deviating from the original's broader input acceptance. While primarily an ESM package, it also provides CommonJS compatibility for wider ecosystem integration. The project appears to follow a release cadence driven by feature parity with the original library, bug fixes, and minor enhancements.","language":"javascript","status":"active","last_verified":"Tue Apr 21","install":{"commands":["npm install set-cookie-parser-es"],"cli":null},"imports":["import { parse } from 'set-cookie-parser-es'","import { parseString } from 'set-cookie-parser-es'","import { splitCookiesString } from 'set-cookie-parser-es'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { parse, parseString, splitCookiesString } from 'set-cookie-parser-es';\n\n// Example 1: Parse a single Set-Cookie header string\nconst singleSetCookieHeader = 'session_id=abc; Path=/; Expires=Wed, 21 Oct 2026 07:28:00 GMT; HttpOnly; Secure';\nconst parsedCookie = parseString(singleSetCookieHeader);\nconsole.log('Parsed single cookie:', parsedCookie);\n\n// Example 2: Parse an array of Set-Cookie header strings\nconst multipleSetCookieHeaders = [\n  'user_token=xyz; Max-Age=3600; HttpOnly',\n  'preferences=theme=dark; Path=/',\n];\nconst parsedCookiesArray = parse(multipleSetCookieHeaders);\nconsole.log('Parsed array of cookies:', parsedCookiesArray);\n\n// Example 3: Split a single string containing multiple Set-Cookie values\n// This is useful if a server concatenates multiple Set-Cookie headers into one string.\nconst concatenatedSetCookies = 'my_app_session=value1; Path=/; Secure, my_app_prefs=value2; Path=/';\nconst splitCookies = splitCookiesString(concatenatedSetCookies);\nconsole.log('Split cookies string:', splitCookies);\n\n// You can then parse the split strings:\nconst parsedSplitCookies = parse(splitCookies);\nconsole.log('Parsed split cookies:', parsedSplitCookies);","lang":"typescript","description":"Demonstrates how to parse single `Set-Cookie` headers, arrays of headers, and split concatenated `Set-Cookie` strings using the library's core functions.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}