{"_id":"@arunvaradharajalu/common.cookies","_rev":"1-4e91b3801ddbf35bbe7e63b43a72916f","name":"@arunvaradharajalu/common.cookies","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@arunvaradharajalu/common.cookies","version":"1.0.0","author":{"name":"Arun Varadharajalu"},"license":"ISC","_id":"@arunvaradharajalu/common.cookies@1.0.0","maintainers":[{"name":"arunvaradharajalu","email":"arunvaradharajalu@gmail.com"}],"homepage":"https://github.com/arunv11u/common.cookies#readme","bugs":{"url":"https://github.com/arunv11u/common.cookies/issues"},"dist":{"shasum":"951cb49875cec7b3b4d1bf9fbbf127068098735b","tarball":"https://registry.npmjs.org/@arunvaradharajalu/common.cookies/-/common.cookies-1.0.0.tgz","fileCount":13,"integrity":"sha512-OAW/jwmBYI6phe8yOWYZE3eB7CRtI685DOGflZmWzw40ugbh+QwjFbAGpHGzOVRIEbZOLI3T2En7TYtVWHS8jg==","signatures":[{"sig":"MEUCIBjVPXXqYRaYryScfYHvAHvoAG7pW+mYROJMissvygyeAiEA0kiQUxXlErRjqjtoE/y6Z4uMREU3notmph3tEJZBXRM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11842},"jest":{"roots":["<rootDir>/test"],"preset":"ts-jest","reporters":["default",["./node_modules/jest-html-reporter",{"pageTitle":"Cookies Test Report"}]],"clearMocks":true,"testEnvironment":"node"},"main":"./build/index.js","types":"./build/index.d.ts","gitHead":"3370565645ab4b08ea9965ecefb98fca616a944a","scripts":{"test":"jest --watchAll --verbose --no-cache --detectOpenHandles --env=node --coverage","build":"npm run clean && tsc --project tsconfig.build.json","clean":"rimraf build"},"_npmUser":{"name":"arunvaradharajalu","email":"arunvaradharajalu@gmail.com"},"repository":{"url":"git+https://github.com/arunv11u/common.cookies.git","type":"git"},"_npmVersion":"10.2.4","description":"This package contains Cookie Implementation class to set and parse cookies.","directories":{},"_nodeVersion":"20.11.0","_hasShrinkwrap":false,"devDependencies":{"rimraf":"^5.0.7","ts-jest":"^29.1.4","@types/jest":"^29.5.12","@types/express":"^4.17.21","jest-html-reporter":"^3.10.2"},"_npmOperationalInternal":{"tmp":"tmp/common.cookies_1.0.0_1727204337241_0.05295694943153384","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@arunvaradharajalu/common.cookies","version":"1.0.1","description":"This package contains Cookie Implementation class to set and parse cookies.","main":"./build/index.js","types":"./build/index.d.ts","scripts":{"clean":"rimraf build","build":"npm run clean && tsc --project tsconfig.build.json","test":"jest --watchAll --verbose --no-cache --detectOpenHandles --env=node --coverage"},"jest":{"preset":"ts-jest","testEnvironment":"node","roots":["<rootDir>/test"],"clearMocks":true,"reporters":["default",["./node_modules/jest-html-reporter",{"pageTitle":"Cookies Test Report"}]]},"repository":{"type":"git","url":"git+https://github.com/arunv11u/common.cookies.git"},"keywords":["common-cookies","common-cookies-package"],"author":{"name":"Arun Varadharajalu"},"license":"ISC","bugs":{"url":"https://github.com/arunv11u/common.cookies/issues"},"homepage":"https://github.com/arunv11u/common.cookies#readme","devDependencies":{"@types/express":"^4.17.21","@types/jest":"^29.5.12","jest-html-reporter":"^3.10.2","rimraf":"^5.0.7","ts-jest":"^29.1.4"},"_id":"@arunvaradharajalu/common.cookies@1.0.1","gitHead":"54ac664cd0ba2e3ef1acc7096d759402f14af1af","_nodeVersion":"20.11.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-y8b96+N5MtNKPypDTE+XEzSa30BbppIgQzMRpx9TUDcvehaXDckg1IAXs1a7W7pBlWAEVFNbQXZbMS3pT8pCrg==","shasum":"c7a911e208588c61e138883b2460d45843085826","tarball":"https://registry.npmjs.org/@arunvaradharajalu/common.cookies/-/common.cookies-1.0.1.tgz","fileCount":13,"unpackedSize":11909,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDFl6XLtg8vatEpBfUNkdJxFA57FuZo0Cjhah6GKDGBLAiA0zj2684B+lH+4IeeZIrQU9N8jD2SD33YvkdHHehnnYw=="}]},"_npmUser":{"name":"arunvaradharajalu","email":"arunvaradharajalu@gmail.com"},"directories":{},"maintainers":[{"name":"arunvaradharajalu","email":"arunvaradharajalu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/common.cookies_1.0.1_1727204473863_0.8377873194610332"},"_hasShrinkwrap":false}},"time":{"created":"2024-09-24T18:58:57.137Z","modified":"2024-09-24T19:01:14.215Z","1.0.0":"2024-09-24T18:58:57.435Z","1.0.1":"2024-09-24T19:01:14.034Z"},"bugs":{"url":"https://github.com/arunv11u/common.cookies/issues"},"author":{"name":"Arun Varadharajalu"},"license":"ISC","homepage":"https://github.com/arunv11u/common.cookies#readme","repository":{"type":"git","url":"git+https://github.com/arunv11u/common.cookies.git"},"description":"This package contains Cookie Implementation class to set and parse cookies.","maintainers":[{"name":"arunvaradharajalu","email":"arunvaradharajalu@gmail.com"}],"readme":"# @arunvaradharajalu/common.cookies\n\n[![npm version](https://badge.fury.io/js/%40arunvaradharajalu%2Fcommon.cookies.svg)](https://www.npmjs.com/package/@arunvaradharajalu/common.cookies)\n[![GitHub issues](https://img.shields.io/github/issues/arunv11u/common.cookies)](https://github.com/arunv11u/common.cookies/issues)\n[![GitHub license](https://img.shields.io/github/license/arunv11u/common.cookies)](https://github.com/arunv11u/common.cookies/blob/master/LICENSE)\n\n## Overview\n\nThis package provides a Cookie Implementation class to handle setting, retrieving, and clearing cookies, including signed cookies, in an Express application.\n\n## Installation\n\nTo install the package, run the following command:\n\n```bash\nnpm install @arunvaradharajalu/common.cookies\n```\n\n## Usage\n\n### Importing the Cookie Implementation\n\n```bash\nimport { CookieImpl } from '@arunvaradharajalu/common.cookies';\n```\n\n### Setting a Cookie\n\n```bash\nconst cookieImpl = new CookieImpl();\ncookieImpl.setCookies(response, { name: Cookies.appnameCookieName, value: 'cookie_value' });\n```\n\n### Setting a Signed Cookie\n\n```bash\ncookieImpl.setSignedCookies(response, { name: SignedCookies.lifeverseChristmasEventAuthToken, value: 'signed_cookie_value' });\n```\n\n### Retrieving Cookies\n\n```bash\nconst cookies = cookieImpl.getCookies(request);\nconsole.log(cookies.appnameCookieName);\n```\n\n### Retrieving Signed Cookies\n\n```bash\nconst signedCookies = cookieImpl.getSignedCookies(request);\nconsole.log(signedCookies.lifeverseChristmasEventAuthToken);\n```\n\n### Clearing a Cookie\n\n```bash\ncookieImpl.clear(response, Cookies.appnameCookieName);\n```\n\n## Types\nThe package includes types for cookies and signed cookies:\n\n- `Cookies`: Enum for standard cookies.\n- `SignedCookies`: Enum for signed cookies.\n- `CookieInput`: Interface for passing cookie name and value.\n- `SignedCookieInput`: Interface for passing signed cookie name and value.\n\n## Tests\n\nTests can be run using:\n\n```bash\nnpm run test\n```\n\nTest results will be available in an HTML format using the jest-html-reporter.\n\n## License\n\nThis project is licensed under the ISC License.\n\n## Issues\n\nFor any issues or bug reports, please visit the GitHub Issues Page.\n\n## Author\n\nArun Varadharajalu","readmeFilename":"README.md","keywords":["common-cookies","common-cookies-package"]}