{"id":50684723,"url":"https://github.com/cbjs-dev/cbjs","last_synced_at":"2026-06-08T22:00:35.133Z","repository":{"id":219187740,"uuid":"739916584","full_name":"cbjs-dev/cbjs","owner":"cbjs-dev","description":"A modern Couchbase SDK for Node.js and TypeScript.","archived":false,"fork":false,"pushed_at":"2026-06-04T13:58:13.000Z","size":17015,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-06-04T14:06:51.380Z","etag":null,"topics":["community","couchbase","http","native","typescript","vitest"],"latest_commit_sha":null,"homepage":"https://cbjs.dev","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cbjs-dev.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,"notice":"NOTICE","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-01-06T23:42:12.000Z","updated_at":"2026-06-04T13:58:49.000Z","dependencies_parsed_at":"2024-12-02T15:21:40.767Z","dependency_job_id":"0d5f9886-670e-4ed9-b979-feae7bdb75cb","html_url":"https://github.com/cbjs-dev/cbjs","commit_stats":null,"previous_names":["cbjs-dev/cbjs"],"tags_count":162,"template":false,"template_full_name":null,"purl":"pkg:github/cbjs-dev/cbjs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbjs-dev%2Fcbjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbjs-dev%2Fcbjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbjs-dev%2Fcbjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbjs-dev%2Fcbjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cbjs-dev","download_url":"https://codeload.github.com/cbjs-dev/cbjs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbjs-dev%2Fcbjs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34082130,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"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":["community","couchbase","http","native","typescript","vitest"],"created_at":"2026-06-08T22:00:26.354Z","updated_at":"2026-06-08T22:00:35.120Z","avatar_url":"https://github.com/cbjs-dev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n \u003cimg alt=\"Cbjs\" src=\"https://github.com/cbjs-dev/cbjs/raw/main/docs/src/public/cbjs-logotype.svg\" height=\"120\" /\u003e\n\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\nA modern Couchbase SDK for Node.js \u0026 TypeScript.\n\u003cp\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"/assets/couchbase-badge.svg\" alt=\"Couchbase Badge\" /\u003e\n \u003ca href=\"https://www.npmjs.com/package/@cbjsdev/cbjs\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@cbjsdev/cbjs?label=cbjs\" /\u003e\u003c/a\u003e\n \u003ca href=\"https://github.com/cbjs-dev/cbjs/actions/workflows/tests.yml\"\u003e\u003cimg src=\"https://github.com/cbjs-dev/cbjs/actions/workflows/tests.yml/badge.svg\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n \u003ca href=\"https://cbjs.dev\"\u003eDocumentation\u003c/a\u003e | \u003ca href=\"https://cbjs.dev/guide/\"\u003eGetting Started\u003c/a\u003e | \u003ca href=\"https://cbjs.dev/guide/why.html\"\u003eWhy Cbjs?\u003c/a\u003e\n\u003c/p\u003e\n\n## Getting started\n\nTo get started with your new Couchbase Node.js SDK, uninstall the official library and install Cbjs :\n\n```bash\nnpm uninstall couchbase\nnpm install @cbjsdev/cbjs\n```\n\n## Compatibility\n\nBuilt on top of the official library, Cbjs is a drop-in replacement for the `couchbase` package.  \nThe package that is specific to your platform is downloaded during the install process.  \nCbjs is also full **ESM native**.\n\nCbjs is your new [Couchbase SDK for Node.js with TypeScript](https://cbjs.dev/guide/features.html#compatible-with-the-official-client).\n\n## Exclusive Features\n\nCbjs has been created to deliver a better DX.  \nBy making extensive usage of TypeScript, Cbjs is able to add some exclusive features.\n\n### Inferred return type for KV operation\n\nBecause Cbjs knows your documents, the return type of KV operations is inferred from the parameters.\n\n\u003cpicture\u003e\n  \u003csource srcset=\"/assets/inferred-return-type-light.png\" media=\"(prefers-color-scheme: light)\" /\u003e\n  \u003csource srcset=\"/assets/inferred-return-type-dark.png\" media=\"(prefers-color-scheme: dark)\" /\u003e\n  \u003cimg src=\"/assets/inferred-return-type-light.png\" alt=\"code sample show casing the inferred return type\" /\u003e\n\u003c/picture\u003e\n\nRead more about [couchbase document path autocomplete](https://cbjs.dev/guide/features.html#inferred-return-type).\n\n### Chainable sub-document operations\n\nAdopt a more elegant syntax by chaining sub-document operations.\n\n```ts\nconst result = await collection.lookupIn('book::001')\n  .get('title')\n  .exists('lastModifiedBy')\n  .count('metadata.tags');\n```\n\nRead more about [chainable lookupIn](https://cbjs.dev/guide/services/kv.html#chainable-sub-doc-operations).\n\n### Path autocomplete for sub-document operation\n\nBecause Cbjs knows your documents, autocompletion is offered when writing a document path.\n\n\u003cpicture\u003e\n  \u003csource srcset=\"/assets/code-completion-light.png\" media=\"(prefers-color-scheme: light)\" /\u003e\n  \u003csource srcset=\"/assets/code-completion-dark.png\" media=\"(prefers-color-scheme: dark)\" /\u003e\n  \u003cimg src=\"/assets/inferred-return-type-light.png\" alt=\"code sample show casing code completion for the path of sub-document operations\" /\u003e\n\u003c/picture\u003e\n\n### Improved types\n\nGreat efforts have been made to improve function signatures and types in general. Here is an example that uses _discriminated unions_ to offer a natural type guard :\n\n```ts\nconst { content: [title] } = await collection.lookupIn(bookId).get('title');\n//                  ^? LookupInResultEntry\u003cstring, null\u003e | LookupInResultEntry\u003cundefined, Error\u003e\n\nif (title.error) {\n  throw new Error('Failed to retrieve the title.');\n}\n\n// Because of the discriminated union, the previous condition acts as a type guard.\n// title: LookupInResultEntry\u003cstring, null\u003e\n```\n\nThe same goes for callbacks and many more ! [Read more](https://cbjs.dev/guide/features.html#discriminated-unions).\n\n### Better Stack Trace\n\nWithout `cbjs` :\n\n```\nnode:internal/process/esm_loader:97\n    internalBinding('errors').triggerUncaughtException(\n```\n\nWith `cbjs` :\n\n```\nDocumentNotFoundError: document not found\n    at errorFromCpp (/yourProject/node_modules/@cbjsdev/cbjs/src/bindingutilities.ts:787:14)\n    at Collection.remove (/yourProject/node_modules/@cbjsdev/cbjs/src/collection.ts:1417:19)\n    at remove (/yourProject/something.ts:31:3)\n```\n\n### Support for cloud lambdas\n\nAccess to the file system via `node:fs` is sometimes unavailable on cloud lambdas like Cloudflare Workers.  \nBecause Cbjs doesn't use it to load the driver binary, it works fine on all cloud lambdas providers.\n\n## License\n\nAll the packages are released under the Apache 2.0 license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcbjs-dev%2Fcbjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcbjs-dev%2Fcbjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcbjs-dev%2Fcbjs/lists"}