{"id":14984979,"url":"https://github.com/cookiedb/cookie_esm","last_synced_at":"2026-01-21T04:33:33.126Z","repository":{"id":63117380,"uuid":"565328521","full_name":"cookiedb/cookie_esm","owner":"cookiedb","description":"A fast and correct cookiedb driver for esm platforms","archived":false,"fork":false,"pushed_at":"2023-02-10T06:20:56.000Z","size":42,"stargazers_count":2,"open_issues_count":4,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-05T15:02:57.661Z","etag":null,"topics":["cookiedb","deno","driver","esm"],"latest_commit_sha":null,"homepage":"https://deno.land/x/cookie_driver","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/cookiedb.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,"zenodo":null}},"created_at":"2022-11-13T03:13:06.000Z","updated_at":"2023-10-21T15:14:19.000Z","dependencies_parsed_at":"2023-02-15T19:01:24.262Z","dependency_job_id":null,"html_url":"https://github.com/cookiedb/cookie_esm","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/cookiedb/cookie_esm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cookiedb%2Fcookie_esm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cookiedb%2Fcookie_esm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cookiedb%2Fcookie_esm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cookiedb%2Fcookie_esm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cookiedb","download_url":"https://codeload.github.com/cookiedb/cookie_esm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cookiedb%2Fcookie_esm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28626276,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T02:47:06.670Z","status":"ssl_error","status_checked_at":"2026-01-21T02:45:44.886Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["cookiedb","deno","driver","esm"],"created_at":"2024-09-24T14:10:01.540Z","updated_at":"2026-01-21T04:33:33.110Z","avatar_url":"https://github.com/cookiedb.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CookieDB for ESM\n\n\u003e A fast and correct [CookieDB](https://cookiedb.com) driver for javascript\n\u003e runtimes (like Deno, Node, or the web)\n\nExamples for how to use this module can be found on the\n[official documentation site](https://docs.cookiedb.com)\n\nDocumentation for this module can be found\n[here](https://deno.land/x/cookie_driver/mod.ts).\n\n## Example\n\n```typescript\nimport { CookieDB } from \"https://deno.land/x/cookie_driver/mod.ts\";\n\n// Initialize instance\nconst cookieDB = new CookieDB(\n  \"http://localhost:8777\",\n  \"UKTZOvKweOG6tyKQl3q1SZlNx7AthowA\",\n);\n\n// Create a table with a schema\nawait cookieDB.createTable(\"users\", {\n  name: \"string\",\n  description: \"nullable string\",\n  age: \"number\",\n});\n\n// Get schema for a table\nawait cookieDB.metaTable(\"users\");\n\n// Get schemas for all table\nawait cookieDB.meta();\n\n// Insert document\nconst cookieFanKey = await cookieDB.insert(\"users\", {\n  name: \"cookie_fan\",\n  description: null,\n  age: 20,\n});\n\ninterface User {\n  name: string;\n  description: string | null;\n  age: number;\n  key: string;\n}\n\n// Get document\nconst cookieFan = await cookieDB.get\u003cUser\u003e(\"users\", cookieFanKey);\n\n// Update document\nawait cookieDB.update\u003cUser\u003e(\"users\", cookieFanKey, {\n  description: \"a huge fan of cookies\",\n  age: 21,\n});\n\n// Select document by query\nconst usersThatStartWithCookie = await cookieDB.select\u003cUser\u003e(\n  \"users\",\n  'starts_with($name, \"cookie\")',\n  {\n    maxResults: 5,\n  },\n);\n\n// Delete document\nawait cookieDB.delete(\"users\", cookieFanKey);\n\n// Delete documents by query\nawait cookieDB.deleteByQuery(\"users\", 'starts_with($name, \"cookie\")');\n\n// Edit the table\nawait cookieDB.editTable(\"users\", {\n  name: \"deprecatedUsers\",\n  schema: {\n    name: \"string\",\n  },\n  alias: {\n    name: \"$name\",\n  },\n});\n\n// Drop the table\nawait cookieDB.dropTable(\"deprecatedUsers\");\n\n// Create a user\nconst { username, token } = await cookieDB.createUser({\n  username: \"cookie_fan\",\n  token: \"a_very_secure_password\",\n});\n\n// Regenerate a user's token\nconst { token: new_token } = await cookieDB.regenerateToken(\n  \"cookie_fan\",\n);\n\n// Delete a user\nawait cookieDB.deleteUser(\"cookie_fan\");\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcookiedb%2Fcookie_esm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcookiedb%2Fcookie_esm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcookiedb%2Fcookie_esm/lists"}