Name Date Size

..11-Jan-20224 KiB

.clang-formatH A D11-Jan-2022417

.editorconfigH A D11-Jan-2022207

.eslintrc.jsH A D11-Jan-20223.1 KiB

.gitignoreH A D11-Jan-2022476

.istanbul.ymlH A D11-Jan-202248

.npmignoreH A D11-Jan-2022612

.prettierrcH A D11-Jan-202296

binding.gypH A D11-Jan-20223.1 KiB

deps/lcb/H11-Jan-20224 KiB

lib/H11-Jan-20224 KiB

LICENSEH A D11-Jan-202211.1 KiB

MakefileH A D11-Jan-2022575

package-lock.jsonH A D11-Jan-2022622.2 KiB

package.jsonH A D11-Jan-20222.1 KiB

README.mdH A D11-Jan-20223.6 KiB

src/H11-Jan-20224 KiB

test/H11-Jan-20224 KiB

tsconfig.jsonH A D11-Jan-2022148

typedoc.jsonH A D11-Jan-2022439

README.md

1# Couchbase Node.js Client
2
3The Node.js SDK library allows you to connect to a Couchbase cluster from
4Node.js. It is a native Node.js module and uses the very fast libcouchbase
5library to handle communicating to the cluster over the Couchbase binary
6protocol.
7
8## Useful Links
9
10Source - [https://github.com/couchbase/couchnode](https://github.com/couchbase/couchnode)
11
12Bug Tracker - [https://www.couchbase.com/issues/browse/JSCBC](https://www.couchbase.com/issues/browse/JSCBC)
13
14Couchbase Developer Portal - [https://docs.couchbase.com/](https://docs.couchbase.com/nodejs-sdk/3.0/hello-world/start-using-sdk.html)
15
16Release Notes - [https://docs.couchbase.com/nodejs-sdk/3.0/project-docs/sdk-release-notes.html](https://docs.couchbase.com/nodejs-sdk/3.0/project-docs/sdk-release-notes.html)
17
18## Installing
19
20To install the lastest release using npm, run:
21
22```bash
23npm install couchbase
24```
25
26To install the development version directly from github, run:
27
28```bash
29npm install "git+https://github.com/couchbase/couchnode.git#master"
30```
31
32## Introduction
33
34Connecting to a Couchbase bucket is as simple as creating a new `Cluster`
35instance to represent the `Cluster` you are using, and then using the
36`bucket` and `collection` commands against this to open a connection to
37open your specific bucket and collection. You are able to execute most
38operations immediately, and they will be queued until the connection is
39successfully established.
40
41Here is a simple example of instantiating a connection, adding a new document
42into the bucket and then retrieving its contents:
43
44```javascript
45var couchbase = require('couchbase')
46
47couchbase.connect(
48  'couchbase://127.0.0.1',
49  {
50    username: 'username',
51    password: 'password',
52  },
53  (err, cluster) => {
54    var bucket = cluster.bucket('default')
55    var coll = bucket.defaultCollection()
56
57    coll.upsert('testdoc', { name: 'Frank' }, (err, res) => {
58      if (err) throw err
59
60      coll.get('testdoc', (err, res) => {
61        if (err) throw err
62
63        console.log(res.value)
64        // {name: Frank}
65      })
66    })
67  }
68)
69```
70
71## Documentation
72
73An extensive documentation is available on the Couchbase website - [https://docs.couchbase.com/nodejs-sdk/3.0/hello-world/start-using-sdk.html](https://docs.couchbase.com/nodejs-sdk/3.0/hello-world/start-using-sdk.html) -
74including numerous examples and code samples.
75
76Visit our [Couchbase Node.js SDK forum](https://forums.couchbase.com/c/node-js-sdk) for help.
77Or get involved in the [Couchbase Community](https://couchbase.com/community) on the [Couchbase](https://couchbase.com) website.
78
79## Source Control
80
81The source code is available at
82[https://github.com/couchbase/couchnode](https://github.com/couchbase/couchnode).
83Once you have cloned the repository, you may contribute changes through our
84gerrit server. For more details see
85[CONTRIBUTING.md](https://github.com/couchbase/couchnode/blob/master/CONTRIBUTING.md).
86
87To execute our test suite, run `make test` from the root directory.
88
89To execute our code coverage, run `make cover` from the root directory.
90
91In addition to the full test suite and full code coverage, you may additionally
92execute a subset of the tests which excludes slow-running tests for quick
93verifications. These can be run through `make fasttest` and `make fastcover`
94respectively.
95
96Finally, to build the API reference for the project, run `make docs` from the
97root directory, and a docs folder will be created with the api reference.
98
99## License
100
101Copyright 2013 Couchbase Inc.
102
103Licensed under the Apache License, Version 2.0.
104
105See
106[LICENSE](https://github.com/couchbase/couchnode/blob/master/LICENSE)
107for further details.
108