{"id":42267875,"url":"https://github.com/cvent/couchbase-driver","last_synced_at":"2026-01-27T06:51:36.193Z","repository":{"id":66123473,"uuid":"64179598","full_name":"cvent/couchbase-driver","owner":"cvent","description":"An improved version of the official Couchbase driver","archived":false,"fork":false,"pushed_at":"2025-09-20T01:19:22.000Z","size":960,"stargazers_count":2,"open_issues_count":12,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-20T03:21:30.354Z","etag":null,"topics":["couchbase"],"latest_commit_sha":null,"homepage":"https://bojand.github.io/couchbase-driver/","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/cvent.png","metadata":{"files":{"readme":"readme.hbs","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":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2016-07-26T01:25:50.000Z","updated_at":"2019-07-10T16:24:47.000Z","dependencies_parsed_at":"2025-02-27T15:37:03.945Z","dependency_job_id":"fe579d63-d661-4d82-876c-100f9fc00ee8","html_url":"https://github.com/cvent/couchbase-driver","commit_stats":{"total_commits":71,"total_committers":2,"mean_commits":35.5,"dds":"0.014084507042253502","last_synced_commit":"d26cb9d5a9d12c0a3861cac97f9eb8eef812a0eb"},"previous_names":["bojand/couchbase-driver"],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/cvent/couchbase-driver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cvent%2Fcouchbase-driver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cvent%2Fcouchbase-driver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cvent%2Fcouchbase-driver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cvent%2Fcouchbase-driver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cvent","download_url":"https://codeload.github.com/cvent/couchbase-driver/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cvent%2Fcouchbase-driver/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28806722,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T06:25:51.065Z","status":"ssl_error","status_checked_at":"2026-01-27T06:25:50.640Z","response_time":168,"last_error":"SSL_read: 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":["couchbase"],"created_at":"2026-01-27T06:51:35.578Z","updated_at":"2026-01-27T06:51:36.182Z","avatar_url":"https://github.com/cvent.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# couchbase-driver\n\nAn improved version of the official Couchbase driver.\n\n## Installation\n\n`npm install couchbase-driver`\n\n## Overview\n\nA simple alternative driver for [Couchbase](http://docs.couchbase.com/sdk-api/couchbase-node-client-2.1.4/) that wraps the `Bucket` from existing driver with the following modifications:\n\n* `get` works on a single key or an array of keys, calling `Bucket.getMulti` if appropriate. Automatically handles\n*key not found* errors and doesn't return an error in that scenario. In case of multiple keys, optionally returns an\narray of missing keys.\n* `remove` also handles *key not found* errors more gracefully.\n* `getAndLock` also handles *key not found* errors more gracefully.\n* adds `atomic` function that tries to do perform `getAndLock` + `transform` + specified database operation utilizing `CAS`\nin one step until success or maximum retries have occurred. By default we use `getAndLock` to lock the document while we\ntransform and perform document operation and unlock. Optionally we can use normal `get` function.\n* adds \u003ccode\u003ePromise\u003c/code\u003e support so that functions call be called with either Node-style callbacks or with Promises.\n* adds option to automatically retry operations on [Couchbase temporary errors](https://developer.couchbase.com/documentation/server/current/sdk/nodejs/handling-error-conditions.html). Uses\n[`async.retry`](http://caolan.github.io/async/docs.html#.retry) and is configurable with the \u003ccode\u003etempRetryTimes\u003c/code\u003e,  \u003ccode\u003etempRetryInterval\u003c/code\u003e and \u003ccode\u003eretryTemporaryErrors\u003c/code\u003e options (defaults to \u003ccode\u003efalse\u003c/code\u003e).\n* adds `getServerVersion` function that attempts to get the server version from the cluster.\n\n## Usage\n\nCreating:\n\n```js\nconst couchbase = require('couchbase');\nconst Driver = require('couchbase-driver');\nconst cluster = new couchbase.Cluster('couchbase://127.0.0.1');\nconst bucket = cluster.openBucket('default');\nconst driver = Driver.create(bucket);\n```\n\nSimple retrieval:\n\n```js\ndriver.get('my_doc_key', (err, res) =\u003e {\n  if (err) return console.log(err)\n  console.dir(res.value)\n});\n```\n\nIf key does not exist `err` *and* `res` will be undefined.\n\nGetting multiple documents:\n\n```js\ndriver.get(['my_doc_key_1', 'my_doc_key_2', 'my_missing_doc_key_3'], (err, results, missing) =\u003e {\n  if (err) return console.log(err);\n  if (mising.length \u003e 0) console.dir(missing); // ['my_missing_doc_key_3']\n  console.dir(res.value);\n});\n```\n\n\"Atomic\" transformations can be achieved using the `atomic` function which attempts to do `get` + `transform` +\nspecified database operation where `CAS` in `get` and the final operation have to match. This uses [`async.retry`](http://caolan.github.io/async/docs.html#.retry) until successful or maximum retries have occurred,\nwhich can be specified in the `Driver` construction or as function option parameter.\n\n```js\nfunction transform(doc) {\n  doc.foo = 'bar';\n  return {\n    value: doc,\n    action: Driver.OPERATIONS.UPSERT\n  };\n}\n\ndriver.atomic('my_doc_key', transform, (err, res) =\u003e {\n  if(err) return console.dir(err);\n  console.dir(res);\n});\n```\n\nWith promises:\n\n```js\nconst result = await driver.get('mykey');\nconsole.dir(result.value); // document\n```\n\nNote that with Promise style call and multiple keys we do not get misses.\n\n```js\nconst results = await driver.get(['mykey1', 'mykey2']);\nconsole.dir(_.map(results, 'value')); // array of documents\n```\n\n## API Reference\n\n{{\u003eall-docs~}}\n\n## Debug logging\n\n[debug](https://npmjs.com/package/debug) package is used for debug logging.\n\n```sh\nDEBUG=couchbase-driver node app.js\n```\n\n## License\n\nCopyright 2015 Bojan D.\n\nLicensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcvent%2Fcouchbase-driver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcvent%2Fcouchbase-driver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcvent%2Fcouchbase-driver/lists"}