{"_id":"ezheaders","_rev":"6-75211bec5f7849f41db55820b47ecfc4","name":"ezheaders","dist-tags":{"latest":"0.1.0"},"versions":{"0.0.1":{"name":"ezheaders","version":"0.0.1","_id":"ezheaders@0.0.1","maintainers":[{"name":"nikosdouvlis","email":"nikosdouvlis@gmail.com"}],"homepage":"https://github.com/clerk/ezheaders#readme","bugs":{"url":"https://github.com/clerk/ezheaders/issues"},"dist":{"shasum":"52600931181010edf578acde1c27ce393f287826","tarball":"https://registry.npmjs.org/ezheaders/-/ezheaders-0.0.1.tgz","fileCount":5,"integrity":"sha512-HTBKDeAx5xnqD43PkywogYoMwxDr2KQv36hftq3f4wrrS+ial7s6Qw8q/vuYwvLT0NTETwBoweBbXl9REYkcJQ==","signatures":[{"sig":"MEUCIGmFEL1TPG85TtZhN1rKuyCh83pPCcTcB77c7UlZeYnjAiEAkMSPDcxz8+e49aO2KMrMLFXqsvX20HK5OmW+yG+0gys=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":7525},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"66ad8c3543a2970bc6fa9d46cda35ee638a114bc","scripts":{"dev":"tsup src/index.ts --format cjs,esm --dts --watch","lint":"eslint . --max-warnings 0","build":"tsup src/index.ts --format cjs,esm --dts"},"_npmUser":{"name":"nikosdouvlis","email":"nikosdouvlis@gmail.com"},"deprecated":"This package has been deprecated","repository":{"url":"git+https://github.com/clerk/ezheaders.git","directory":"packages/ezheaders"},"_npmVersion":"10.8.2","directories":{},"_nodeVersion":"20.18.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.0","eslint":"^8.57.0","typescript":"^5.3.3","@types/eslint":"^8.56.5","@repo/eslint-config":"*","@repo/typescript-config":"*"},"peerDependencies":{"next":"^15"},"_npmOperationalInternal":{"tmp":"tmp/ezheaders_0.0.1_1729606214905_0.5092122679171593","host":"s3://npm-registry-packages"}},"0.0.2":{"name":"ezheaders","version":"0.0.2","_id":"ezheaders@0.0.2","maintainers":[{"name":"nikosdouvlis","email":"nikosdouvlis@gmail.com"}],"homepage":"https://github.com/clerk/ezheaders#readme","bugs":{"url":"https://github.com/clerk/ezheaders/issues"},"dist":{"shasum":"34abca975ded7f0855e565e1667ccdd3407567d2","tarball":"https://registry.npmjs.org/ezheaders/-/ezheaders-0.0.2.tgz","fileCount":6,"integrity":"sha512-48YJkdWu/xmy/Nc8nq67P8HRZ/bME0aBA0i9YkFK1JNsBf0G8sayqJ0x2/XFJkttpWeTyoHCWmjLjXZFHGBkOg==","signatures":[{"sig":"MEYCIQCHhMD6yEny/jO/SQUf4qLalgZzqDdyNhtDTYAyuG875gIhAO3HfeiRX8CDaR4b57qMVGLmqZNULHOuxh6rUjJsstLP","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13362},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"0b4f407c2eb6e97edec68912d5ffa0696568ddac","scripts":{"dev":"tsup src/index.ts --format cjs,esm --dts --watch","lint":"eslint . --max-warnings 0","build":"tsup src/index.ts --format cjs,esm --dts"},"_npmUser":{"name":"nikosdouvlis","email":"nikosdouvlis@gmail.com"},"deprecated":"This package has been deprecated","repository":{"url":"git+https://github.com/clerk/ezheaders.git","directory":"packages/ezheaders"},"_npmVersion":"10.8.2","description":"<p align=\"center\">   <a href=\"https://clerk.com?utm_source=github&utm_medium=clerk_javascript\" target=\"_blank\" rel=\"noopener noreferrer\">     <picture>       <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://images.clerk.com/static/logo-dark-mo","directories":{},"_nodeVersion":"20.18.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.0","eslint":"^8.57.0","typescript":"^5.3.3","@types/eslint":"^8.56.5","@repo/eslint-config":"*","@repo/typescript-config":"*"},"peerDependencies":{"next":"^15"},"_npmOperationalInternal":{"tmp":"tmp/ezheaders_0.0.2_1729674226872_0.7354883713282474","host":"s3://npm-registry-packages"}},"0.0.3":{"name":"ezheaders","version":"0.0.3","_id":"ezheaders@0.0.3","maintainers":[{"name":"nikosdouvlis","email":"nikosdouvlis@gmail.com"}],"homepage":"https://github.com/clerk/ezheaders#readme","bugs":{"url":"https://github.com/clerk/ezheaders/issues"},"dist":{"shasum":"88f2ac4bdb4e320eb02573fdb2656eef973ce4ac","tarball":"https://registry.npmjs.org/ezheaders/-/ezheaders-0.0.3.tgz","fileCount":6,"integrity":"sha512-fpY0uX3Hw1FuSwlOR+8Ee+vWcp5a+AnP48VZvA4veQgp8j+ZTljRueBa2BewhaBUIJUytUkwuytQHeS4u8cxaQ==","signatures":[{"sig":"MEUCIErtDDMaOffAP3+WCK4lJNEb5hGyA52Zy7P4Y3OELzyyAiEA0YgfhAzBAu71pbjx2O9kdHek0iB3LAo1WnJayfZpg4Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/ezheaders@0.0.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":11169},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"ca3733e2269c5ac5dfc1e82b41671be00e32221c","scripts":{"dev":"tsup src/index.ts --format cjs,esm --dts --watch","lint":"eslint . --max-warnings 0","test":"vitest","build":"tsup src/index.ts --format cjs,esm --dts"},"_npmUser":{"name":"nikosdouvlis","email":"nikosdouvlis@gmail.com"},"deprecated":"This package has been deprecated","repository":{"url":"git+https://github.com/clerk/ezheaders.git","directory":"packages/ezheaders"},"_npmVersion":"10.8.2","description":"<p align=\"center\">   <a href=\"https://clerk.com?utm_source=github&utm_medium=clerk_javascript\" target=\"_blank\" rel=\"noopener noreferrer\">     <picture>       <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://images.clerk.com/static/logo-dark-mo","directories":{},"_nodeVersion":"20.18.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.0","eslint":"^8.57.0","typescript":"^5.3.3","@types/eslint":"^8.56.5","@repo/eslint-config":"*","@repo/typescript-config":"*"},"peerDependencies":{"next":"^14 || ^15"},"_npmOperationalInternal":{"tmp":"tmp/ezheaders_0.0.3_1730319641177_0.40603081405619723","host":"s3://npm-registry-packages"}},"0.1.0":{"name":"ezheaders","version":"0.1.0","_id":"ezheaders@0.1.0","maintainers":[{"name":"nikosdouvlis","email":"nikosdouvlis@gmail.com"}],"homepage":"https://github.com/clerk/ezheaders#readme","bugs":{"url":"https://github.com/clerk/ezheaders/issues"},"dist":{"shasum":"af53c78fdbc2aaeae665f2145291e3279d5d25e7","tarball":"https://registry.npmjs.org/ezheaders/-/ezheaders-0.1.0.tgz","fileCount":6,"integrity":"sha512-U0wdCs2dS+IzFuxyHGyw1aWhiunW22sGqnyH4yQsovkgqUvO4YSbzQ5BQzV6HY4oFlNnK+TbFGJj8rvvX5aN7w==","signatures":[{"sig":"MEUCIQCKdhne46cyCi4q1ClT5gNB9vDldtwqAXDTuWksLPApRgIgKIBcJrb7rpI1Llpi9tq3havg3wF0Jb3aY4BJSLBA+Yc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/ezheaders@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":10736},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"75c7b7359aabc4ed4ced4675c66b3e8eec5cfd91","scripts":{"dev":"tsup src/index.ts --format cjs,esm --dts --watch","lint":"eslint . --max-warnings 0","test":"vitest","build":"tsup src/index.ts --format cjs,esm --dts"},"_npmUser":{"name":"nikosdouvlis","email":"nikosdouvlis@gmail.com"},"deprecated":"This package has been deprecated","repository":{"url":"git+https://github.com/clerk/ezheaders.git","directory":"packages/ezheaders"},"_npmVersion":"10.8.2","description":"<p align=\"center\">   <a href=\"https://clerk.com?utm_source=github&utm_medium=clerk_javascript\" target=\"_blank\" rel=\"noopener noreferrer\">     <picture>       <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://images.clerk.com/static/logo-dark-mo","directories":{},"_nodeVersion":"20.18.0","_hasShrinkwrap":false,"devDependencies":{"next":"13.5.4","tsup":"^8.3.0","eslint":"^8.57.0","typescript":"^5.3.3","@types/eslint":"^8.56.5","@repo/eslint-config":"*","@repo/typescript-config":"*"},"peerDependencies":{"next":"^13.5.4 || ^14 || ^15"},"_npmOperationalInternal":{"tmp":"tmp/ezheaders_0.1.0_1730371666429_0.3619860134820925","host":"s3://npm-registry-packages"}}},"time":{"created":"2024-10-22T14:10:14.777Z","modified":"2025-11-04T11:22:46.008Z","0.0.1":"2024-10-22T14:10:15.109Z","0.0.2":"2024-10-23T09:03:47.041Z","0.0.3":"2024-10-30T20:20:41.372Z","0.1.0":"2024-10-31T10:47:46.610Z"},"bugs":{"url":"https://github.com/clerk/ezheaders/issues"},"homepage":"https://github.com/clerk/ezheaders#readme","repository":{"url":"git+https://github.com/clerk/ezheaders.git","directory":"packages/ezheaders"},"description":"<p align=\"center\">   <a href=\"https://clerk.com?utm_source=github&utm_medium=clerk_javascript\" target=\"_blank\" rel=\"noopener noreferrer\">     <picture>       <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://images.clerk.com/static/logo-dark-mo","maintainers":[{"name":"nikosdouvlis","email":"nikosdouvlis@gmail.com"}],"readme":"<p align=\"center\">\n  <a href=\"https://clerk.com?utm_source=github&utm_medium=clerk_javascript\" target=\"_blank\" rel=\"noopener noreferrer\">\n    <picture>\n      <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://images.clerk.com/static/logo-dark-mode-400x400.png\">\n      <img src=\"https://images.clerk.com/static/logo-light-mode-400x400.png\" height=\"64\">\n    </picture>\n  </a>\n  <br />\n</p>\n<h1 align=\"center\">\n  ezheaders by Clerk\n</h1>\n<p align=\"center\">\n  <strong>\n    Clerk helps developers build user management. We provide streamlined user experiences for your users to sign up, sign in, and manage their profile.\n  </strong>\n</p>\n\n[![chat on Discord](https://img.shields.io/discord/856971667393609759.svg?logo=discord)](https://clerk.com/discord)\n[![documentation](https://img.shields.io/badge/documentation-clerk-green.svg)](https://clerk.com/docs)\n[![twitter](https://img.shields.io/twitter/follow/ClerkDev?style=social)](https://twitter.com/intent/follow?screen_name=ClerkDev)\n\n---\n\n**Clerk is Hiring!**\n\nWould you like to work on Open Source software and help maintain this repository? [Apply today!](https://jobs.ashbyhq.com/clerk)\n\n---\n\n## Introduction\nEnjoy a more readable API with `header()` and `cookie()` - no more juggling intermediate variables or extra parentheses when handling `await`.\nPlus, a way to use `headers` and `cookies` as variable names without renaming the NextJS APIs upon import.\n\nThis lightweight package provides drop-in replacements and handy utilities that not only let you reclaim those variable names but also offer a more readable API.\n\n## Why EZHeaders?\n\nBecause naming things is hard enough without your tools getting in the way. With `ezheaders`, you can keep your code intuitive and your variable names straightforward.\n\n- **Simplified Async Access:** With `header()` and `cookie()`, you can access specific headers and cookies directly, without intermediate variables or extra `await` parentheses. This makes your asynchronous code cleaner and more readable.\n- **No More Awkward Names:** Stop settling for `headerStore` or `cookieJar`.\n- **Cleaner Code:** Write code that's easy to read and maintain.\n- **Zero Configuration:** Just install and import. It's that easy!\n- **Tree-shakable:** Only import what you need. No more bloated bundles.\n\n## Installation\n\n```bash\nnpm install ezheaders\n```\n\n## Usage examples\n\n### Using `header()`\n\nWith the new async nature of `headers` in Next.js, accessing a specific header often requires extra steps. `header()` simplifies this by allowing you to retrieve a header value directly, without intermediate variables or extra parentheses.\n\n```jsx\nimport { header } from 'ezheaders';\n\nconst contentType = await header('Content-Type');\n```\n\n### Using `cookie()`\n\nSimilarly, `cookie()` lets you access a specific cookie directly, making your code cleaner and more readable.\n\n```jsx\nimport { cookie } from 'ezheaders';\n\nconst sessionId = await cookie('sessionId');\n```\n\nIf you need to set a cookie, simply pass a value as the second argument.\n\n```jsx\nimport { cookie } from 'ezheaders';\nawait cookie('sessionId', 'abc123')\n```\n\n### Using `getHeaders()`\n\nIf you prefer working with the entire headers object, `getHeaders()` lets you use `headers` as a variable name without conflicts.\n\n```jsx\nimport { getHeaders } from 'ezheaders';\n\nconst headers = await getHeaders();\nconst contentType = headers.get('Content-Type');\n```\n\n### Using `getCookies()`\n\nLikewise, `getCookies()` lets you use `cookies` as a variable name, keeping your code intuitive.\n\n```jsx\nimport { getCookies } from 'ezheaders';\n\nconst cookies = await getCookies();\nconst theme = cookies.get('theme');\n```\n\n## API Reference\n\nFor detailed information on each function, refer to the inline documentation.\n\n## Contributing\n\nContributions are welcome! If you have ideas for improvements or new features, feel free to open an issue or submit a pull request.\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/my-awesome-feature`)\n3. Commit your changes (`git commit -am 'Add my awesome feature'`)\n4. Push to the branch (`git push origin feature/my-awesome-feature`)\n5. Open a Pull Request\n\n## License\n\nThis project is licensed under the MIT License.\n","readmeFilename":"README.md"}