{"id":23477339,"url":"https://github.com/vuebits/cookies","last_synced_at":"2025-04-13T13:44:47.432Z","repository":{"id":57169272,"uuid":"344445579","full_name":"vuebits/cookies","owner":"vuebits","description":"Vue 3 library for cookie management","archived":false,"fork":false,"pushed_at":"2021-03-04T11:55:00.000Z","size":175,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-19T17:02:28.527Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vuebits.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}},"created_at":"2021-03-04T11:07:12.000Z","updated_at":"2021-03-04T11:55:02.000Z","dependencies_parsed_at":"2022-09-13T19:11:31.970Z","dependency_job_id":null,"html_url":"https://github.com/vuebits/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/vuebits%2Fcookies","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vuebits%2Fcookies/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vuebits%2Fcookies/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vuebits%2Fcookies/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vuebits","download_url":"https://codeload.github.com/vuebits/cookies/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248724490,"owners_count":21151557,"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-12-24T18:26:41.557Z","updated_at":"2025-04-13T13:44:47.405Z","avatar_url":"https://github.com/vuebits.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eVuebits cookies\u003c/h1\u003e\n\n\u003ch4 align=\"center\"\u003e*** Maintainers \u0026 Contributors welcome ***\u003c/h4\u003e\n\n\u003ch4 align=\"center\"\u003eVue 3 library for cookies management\u003c/h4\u003e\n\n---\n\n## Table of Contents\n\n* [Installation](#installation)\n* [API](#api)\n* [Documentation](#documentation)\n\n\n## Installation\n\n`npm i @vuebits/cookies` / `yarn add @vuebits/cookies`\n\nAnd install in your entry file (e.g. `main.js`):\n\n```javascript\nimport { createCookies } from '@vuebits/cookies';\n\ncreateApp(App).use(createCookies({ /* your config here */ })).mount('#app');\n```\n\n## API\n\n### Available functions:\n\n* `createCookies (options: CookiesConfig)`:\n\n```ts\ninterface CookiesConfig {\n  expireTimes?: string | number | Date;\n  path?: string;\n  domain?: string;\n  secure?: boolean;\n  sameSite?: string;\n}\n```\n\n### Vue instance properties and methods:\n\n* `$cookies: Cookies`:\n\n```ts\ninterface Cookies {\n  config(config: CookiesConfig): void;\n  set(keyName: string,\n    value: any,\n    expireTimes?: string | number | Date,\n    path?: string,\n    domain?: string,\n    secure?: boolean,\n    sameSite?: string): this;\n  get(keyName: string): any;\n  remove(keyName: string, path?: string, domain?: string): boolean;\n  isKey(keyName: string): boolean;\n  keys(): string[];\n}\n```\n\n### Examples\n\n```vue\n\u003ctemplate\u003e\n  \u003cmain\u003e\n    \u003cbutton @click=\"setCookie\"\u003e\n      Set cookie \"test\"\n    \u003c/button\u003e\n    \u003cbutton @click=\"getCookie\"\u003e\n      Get cookie \"test\"\n    \u003c/button\u003e\n    \u003cbutton @click=\"removeCookie\"\u003e\n      Remove cookie \"test\"\n    \u003c/button\u003e\n    \u003cdiv\u003e\n      cookie \"test\": {{ cookie }}\n    \u003c/div\u003e\n  \u003c/main\u003e\n\u003c/template\u003e\n\n\u003cscript lang=\"ts\"\u003e\nimport { defineComponent } from 'vue';\n\nexport default defineComponent({\n  name: 'App',\n  data () {\n    return {\n      cookie: null as any\n    };\n  },\n  methods: {\n    setCookie (): void {\n      this.$cookies.set('test', 123);\n    },\n    getCookie (): void {\n      this.cookie = this.$cookies.get('test');\n    },\n    removeCookie (): void {\n      this.$cookies.remove('test');\n    }\n  }\n});\n\u003c/script\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvuebits%2Fcookies","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvuebits%2Fcookies","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvuebits%2Fcookies/lists"}