{"id":20569033,"url":"https://github.com/kenmueller/web-cookies","last_synced_at":"2026-05-26T13:47:40.680Z","repository":{"id":35114767,"uuid":"208530874","full_name":"kenmueller/web-cookies","owner":"kenmueller","description":"Cookie package for the browser","archived":false,"fork":false,"pushed_at":"2023-01-04T10:22:58.000Z","size":337,"stargazers_count":1,"open_issues_count":12,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-05-28T15:30:20.996Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kenmueller.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-15T02:26:46.000Z","updated_at":"2019-09-20T22:51:32.000Z","dependencies_parsed_at":"2023-01-15T14:15:42.511Z","dependency_job_id":null,"html_url":"https://github.com/kenmueller/web-cookies","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenmueller%2Fweb-cookies","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenmueller%2Fweb-cookies/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenmueller%2Fweb-cookies/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenmueller%2Fweb-cookies/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kenmueller","download_url":"https://codeload.github.com/kenmueller/web-cookies/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242182945,"owners_count":20085594,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T04:55:42.190Z","updated_at":"2026-05-26T13:47:35.657Z","avatar_url":"https://github.com/kenmueller.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **web-cookies**\n\n**Manipulate cookies in the browser**\n\n## **Use in the browser**\n\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/gh/kenmueller/web-cookies/browser/index.min.js\"\u003e\u003c/script\u003e\n```\n\n## **npm**\n\n```bash\nnpm i web-cookies\n```\n\n## **Functions**\n\n- **[`all`](#all-function)**\n- **[`get`](#get-function)**\n- **[`set`](#set-function)**\n- **[`remove`](#remove-function)**\n- **[`exists`](#exists-function)**\n\n\u003cdiv id=\"all-function\"\u003e\u003c/div\u003e\n\n```typescript\n/**\n * Get all the cookies on the page\n *\n * @returns A key/value pair of all the cookies on the page\n * @type `{ [name: string]: string }`\n */\nfunction all(): { [name: string]: string }\n```\n\n\u003cdiv id=\"get-function\"\u003e\u003c/div\u003e\n\n```typescript\n/**\n * Get the value for the specified cookie\n *\n * @param name The name of the cookie\n * @returns The cookie's value of type `string`. Returns `undefined` if the cookie doesn't exist.\n */\nfunction get(name: string): string | undefined\n```\n\n\u003cdiv id=\"set-function\"\u003e\u003c/div\u003e\n\n```typescript\n/**\n * Set the value of a cookie\n *\n * @param name The name of the cookie\n * @param value The cookie's value\n * @param options.expiration\n *\n * The expiration of the cookie.\n *\n * If give an expiration of `'never'` or `null`, the cookie never expires.\n *\n * By default, the cookie expires on browser session end.\n *\n * Otherwise, you can specify a `Date` or a `string` for the expiration.\n *\n * @param options.path The path of the cookie. By default, it is `'/'`.\n * @returns The cookie's record. Includes its name, value, expiration, and path\n */\nfunction set(\n\tname: string,\n\tvalue: any,\n\toptions?: { expiration?: string | null | Date, path?: string }\n): { name: string, value: any, expiration: Date | undefined, path: string }\n```\n\n\u003cdiv id=\"remove-function\"\u003e\u003c/div\u003e\n\n```typescript\n/**\n * Removes a cookie and returns the name\n *\n * @param name The name of the cookie\n * @returns The name of the cookie that was removed\n */\nfunction remove(name: string): string\n```\n\n\u003cdiv id=\"exists-function\"\u003e\u003c/div\u003e\n\n```typescript\n/**\n * Check if a cookie exists\n *\n * @param name The name of the cookie\n * @returns Whether the cookie exists or not\n */\nfunction exists(name: string): boolean\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkenmueller%2Fweb-cookies","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkenmueller%2Fweb-cookies","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkenmueller%2Fweb-cookies/lists"}