https://github.com/unjs/cookie-es
🍪 Cookie and Set-Cookie parser and serializer
https://github.com/unjs/cookie-es
Last synced: 15 days ago
JSON representation
🍪 Cookie and Set-Cookie parser and serializer
- Host: GitHub
- URL: https://github.com/unjs/cookie-es
- Owner: unjs
- License: other
- Created: 2021-11-22T23:16:35.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-01-16T23:27:19.000Z (5 months ago)
- Last Synced: 2025-01-17T00:25:06.119Z (5 months ago)
- Language: TypeScript
- Homepage:
- Size: 498 KB
- Stars: 173
- Watchers: 2
- Forks: 9
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# 🍪 cookie-es
[](https://npmjs.com/package/cookie-es)
[](https://npm.chart.dev/cookie-es)
[](https://bundlejs.com/?q=cookie-es)
[](https://packagephobia.com/result?p=cookie-es)
[](https://codecov.io/gh/unjs/cookie-es)ESM ready [`Cookie`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cookie) and [`Set-Cookie`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie) parser and serializer based on [cookie](https://github.com/jshttp/cookie) and [set-cookie-parser](https://github.com/nfriedly/set-cookie-parser) with built-in types.
## Usage
Install:
```sh
# ✨ Auto-detect (npm, yarn, pnpm, bun, deno)
npx nypm install cookie-es
```Import:
**ESM** (Node.js, Bun, Deno)
```js
import {
parse,
serialize,
parseSetCookie,
splitSetCookieString,
} from "cookie-es";
```**CDN** (Deno, Bun and Browsers)
```js
import {
parse,
serialize,
parseSetCookie,
splitSetCookieString,
} from "https://esm.sh/cookie-es";
```## License
[MIT](./LICENSE)
Based on [jshttp/cookie](https://github.com/jshttp/cookie) (Roman Shtylman and hristopher Wilson) and [nfriedly/set-cookie-parser](https://github.com/nfriedly/set-cookie-parser) (Nathan Friedly).