{"id":20494317,"url":"https://github.com/voltra/cooky","last_synced_at":"2026-06-17T16:03:19.471Z","repository":{"id":57207090,"uuid":"114984801","full_name":"Voltra/cooky","owner":"Voltra","description":"A lightweight library to handle simple cookies in JS","archived":false,"fork":false,"pushed_at":"2023-04-20T01:29:38.000Z","size":174,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-09T03:39:56.556Z","etag":null,"topics":["cookie-string","cookies","javascript","javascript-library"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Voltra.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-21T08:58:02.000Z","updated_at":"2023-08-03T03:16:30.000Z","dependencies_parsed_at":"2024-11-15T17:39:11.228Z","dependency_job_id":"1cfe4cfc-c0af-4699-9ddb-32d7743addf9","html_url":"https://github.com/Voltra/cooky","commit_stats":{"total_commits":10,"total_committers":2,"mean_commits":5.0,"dds":0.09999999999999998,"last_synced_commit":"99086c3ff5d4c590e41f601d04292a0380a10f81"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Voltra/cooky","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Voltra%2Fcooky","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Voltra%2Fcooky/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Voltra%2Fcooky/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Voltra%2Fcooky/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Voltra","download_url":"https://codeload.github.com/Voltra/cooky/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Voltra%2Fcooky/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269948859,"owners_count":24501821,"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","status":"online","status_checked_at":"2025-08-11T02:00:10.019Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cookie-string","cookies","javascript","javascript-library"],"created_at":"2024-11-15T17:39:05.756Z","updated_at":"2025-10-26T20:07:45.024Z","avatar_url":"https://github.com/Voltra.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cooky\n\n`cooky` is a lightweight library that is used as a wrapper around the native JS cookie handling system.\n\nIt encapsulates all necessary methods in an handy object instead of using `document.cookie` in that fancily strange manner (aka `document.cookie = \"mynewcookie=pingas\"` to add a cookie and `document.cookie` to get the whole cookie string).\n\n\n\n## How to install ?\n\nFirst, download the library either from [github](https://github.com/Voltra/cooky) or [npm](https://www.npmjs.com/package/cooky) (`npm i -S cooky`).\n\nThen import/load it :\n\n```js\n//es \u003e= 6\nimport { Cooky } from \"cooky\"\n```\n\n```js\n//node\nconst { Cooky } = require(\"cooky\");\n```\n\n```html\n\u003c!-- as a script tag --\u003e\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003c!-- [...] --\u003e\n    \u003cscript src=\"path/to/cooky.js\"\u003e\u003c/script\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003c!-- [...] --\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\nThen you'll be able to use it (either as `cooky.Cooky` or `Cooky` for in-browser use).\n\n\n\n## Functionalities\n\n### has\n\n`Cooky.has(name : String)`\n\nDetermines whether or not there's a cookie associated to the given name.\n\n**\u003cu\u003eWarning:\u003c/u\u003e** Throws an error if `name` is not a `String`\n\n\n\n### getAll\n\n`Cooky.getAll()`\n\nRetrieves the cookies as an array of objects that follow the following pattern:\n\n```js\n{\n  name: String,\n  value: String\n}\n```\n\n**\u003cu\u003eWarning:\u003c/u\u003e** Throws an error if there has been a problem while parsing the cookie string.\n\n\n\n### getAllAsObject\n\n`Cooky.getAllAsObject()`\n\nRetrieves the cookies, but instead of returning an array of object, it returns an objects that has the names of the cookies as keys and their respective values as values.\n\n\n\n### getAllAsMap\n\n`Cooky.getAllAsMap()`\n\nRetrieves the cookies just like `getAllAsObject` but send back a `Map` insted of a regular `Object` (only if available, otherwise it would throw an error).\n\n\n\n### get\n\n`Cooky.get(name : String)`\n\nRetrieves the cookie that has `name` as its name.\n\n**\u003cu\u003eWarning:\u003c/u\u003e** Will throw an exception if `name` is not a `String`.\n\n\n\n### set\n\n`Cooky.set(name : String, value : String)`\n\nCreates a new cookie that corresponds to `name=value; ` \n\n**\u003cu\u003eNB:\u003c/u\u003e** You can chain `set`\n\n\n\n## Compatibility\n\nSince the source code of `cooky` was written using ES6+ syntax and transpiled using `babel` and its preset `env` with default settings, the compatibilities are the one you obtain from transpiling using `env` with its default settings.\n\n## Changes\n### v2.0.0\nIn version 2.1.0, the cookie parsing algorithm has been revisited to allow parsing of object-like cookies and use of `decodeURIComponent` for some backend technologies.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoltra%2Fcooky","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvoltra%2Fcooky","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoltra%2Fcooky/lists"}