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.
npm install set-cookie-parser-esVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to parse single `Set-Cookie` headers, arrays of headers, and split concatenated `Set-Cookie` strings using the library's core functions.
Manually extract `Set-Cookie` headers from the response object (e.g., `response.headers['set-cookie']` or `res.getHeader('set-cookie')`) before passing to `parse` or `parseString`.Ensure only valid `Set-Cookie` header strings are passed to `splitCookiesString`. For parsing `Cookie` request headers, use a dedicated parser for that specific format.
Use named imports for ESM (`import { parse } from 'set-cookie-parser-es'`) or destructuring for CommonJS (`const { parse } = require('set-cookie-parser-es')`).Extract the `set-cookie` header values from the Node.js response object first. For example, `parse(response.headers['set-cookie'])` for an array of headers or `parseString(response.headers['set-cookie'][0])` for a single header.
No dependency data recorded yet.