{"id":15889095,"url":"https://github.com/arshadkazmi42/cookie-crud","last_synced_at":"2025-09-02T23:45:00.125Z","repository":{"id":44797078,"uuid":"198028352","full_name":"arshadkazmi42/cookie-crud","owner":"arshadkazmi42","description":"CRUD operation on browser sqlite cookie store (cross platform)","archived":false,"fork":false,"pushed_at":"2022-09-12T15:18:03.000Z","size":545,"stargazers_count":2,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-28T23:57:45.241Z","etag":null,"topics":["browser","chrome","cookie","crud","firefox","sqlite"],"latest_commit_sha":null,"homepage":"","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/arshadkazmi42.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"arshadkazmi42"}},"created_at":"2019-07-21T07:49:29.000Z","updated_at":"2022-09-19T06:02:24.000Z","dependencies_parsed_at":"2022-09-09T05:01:00.041Z","dependency_job_id":null,"html_url":"https://github.com/arshadkazmi42/cookie-crud","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arshadkazmi42%2Fcookie-crud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arshadkazmi42%2Fcookie-crud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arshadkazmi42%2Fcookie-crud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arshadkazmi42%2Fcookie-crud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arshadkazmi42","download_url":"https://codeload.github.com/arshadkazmi42/cookie-crud/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244066191,"owners_count":20392407,"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":["browser","chrome","cookie","crud","firefox","sqlite"],"created_at":"2024-10-06T06:41:13.959Z","updated_at":"2025-03-20T10:31:10.628Z","avatar_url":"https://github.com/arshadkazmi42.png","language":"JavaScript","funding_links":["https://github.com/sponsors/arshadkazmi42"],"categories":[],"sub_categories":[],"readme":"# cookie-crud\n\n[![Build](https://github.com/ryuusama09/cookie-crud/actions/workflows/nodejs.yml/badge.svg)](https://github.com/ryuusama09/cookie-crud/actions/workflows/nodejs.yml)\n[![NPM Version](https://img.shields.io/npm/v/cookie-crud.svg)](https://www.npmjs.com/package/cookie-crud)\n[![NPM Downloads](https://img.shields.io/npm/dt/cookie-crud.svg)](https://www.npmjs.com/package/cookie-crud)\n[![Github Repo Size](https://img.shields.io/github/repo-size/ryuusama09/cookie-crud.svg)](https://github.com/ryuusama09/cookie-crud)\n[![LICENSE](https://img.shields.io/npm/l/cookie-crud.svg)](https://github.com/ryuusama09/cookie-crud/blob/master/LICENSE)\n[![Contributors](https://img.shields.io/github/contributors/ryuusama09/cookie-crud.svg)](https://github.com/ryuusama09/cookie-crud/graphs/contributors)\n[![Commit](https://img.shields.io/github/last-commit/ryuusama09/cookie-crud.svg)](https://github.com/ryuusama09/cookie-crud/commits/master)\n\nCRUD operations on browser cookies store in Sqlite. ( CrossPlatform )\n\n## Install\n\n```\nnpm i cookie-crud\n```\n\n## Usage\n\n```javascript\n\nconst CookieCrud = require('cookie-crud');\nconst CC = new CookieCrud();\n\nconst ChromeCookie = CC.getChrome();\nconst FirefoxCookie = CC.getFirefox();\n\n// Reading cookie\nconst cookie = await FirefoxCookie.getCookie('arshad.com');\n\n// Inserting cookie\nconst DATA = [\n  {\n    'baseDomain': 'arshad.com',\n    'originAttributes': '',\n    'name': 'arshad',\n    'value': 'arshad-test-cookie',\n    'host': 'arshad.com',\n    'path': '/root',\n    'expiry': 1,\n    'lastAccessed': 111111111,\n    'creationTime': 10001110,\n    'isSecure': 1,\n    'isHttpOnly': 0,\n    'inBrowserElement': 0,\n    'sameSite': 0,\n  }\n];\n\nawait FirefoxCookie.setCookie(DATA);\n\n\n// Reading cookie\nconst cookie = await ChromeCookie.getCookie('arshad.com');\n\n// Inserting cookie\nconst DATA = [\n  {\n    'creation_utc': 'now',\n    'encrypted_value': 'enc2',\n    'expires_utc': 'never',\n    'has_expires': 'yes',\n    'host_key': 'arshad.com',\n    'is_httponly': 'yes',\n    'is_persistent': 'no',\n    'is_secure': 'yes',\n    'last_access_utc': 'now',\n    'name': 'arshad',\n    'path': '/root',\n    'priority': 'no',\n    'value': 'kazmi',\n    'samesite': -1\n  }\n];\n\nawait ChromeCookie.setCookie(DATA);\n\n```\n\n## API\n\n- **`getCookie(path)`**\n  - Returns cookie json from database for the input path\n    - **Params**\n      - path (String)\n\n- **`setCookie(cookies)`**\n  - Adds all the input cookies into the sqlite database\n    - **Params**\n      - cookies (Array of cookies object)\n\n- **`removeCookie(domain)`**\n  - Removes all records matching the domain.\n  - \u003e It uses `like` condition (`%domain%`) so anything matching the pattern will be removed\n    - **Params**\n      - path (String)\n\n\u003e Same APIs are available for all the browsers\n\n## Supported Browsers\n\n- Firefox\n- Chrome\n\n## Contributing\n\nInterested in contributing to this project?\nYou can log any issues or suggestion related to this library [here](https://github.com/arshadkazmi42/cookie-crud/issues/new)\n\nRead our contributing [guide](CONTRIBUTING.md) on getting started with contributing to the codebase\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farshadkazmi42%2Fcookie-crud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farshadkazmi42%2Fcookie-crud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farshadkazmi42%2Fcookie-crud/lists"}