diff --git a/README.md b/README.md index 8a33830..03bde7d 100644 --- a/README.md +++ b/README.md @@ -502,6 +502,16 @@ Listen to db updates, the available `params` are: * `params.timeout` – Number of seconds until CouchDB closes the connection. Default is 60. * `params.heartbeat` – Whether CouchDB will send a newline character (\n) on timeout. Default is true. +### nano.info([callback]) + +Fetch information about the CouchDB cluster: + +```js +const info = await nano.info() +``` + +The response is an object with [CouchDB cluster information](https://docs.couchdb.org/en/stable/intro/api.html#server). + ## Document functions ### db.insert(doc, [params], [callback]) @@ -585,9 +595,10 @@ const response = await alice.bulk({ docs: documents }) List all the docs in the database . ```js -const doclist = await alice.list().then((body) -doclist.rows.forEach((doc) => { - console.log(doc); +const doclist = await alice.list().then((body)=>{ + body.rows.forEach((doc) => { + console.log(doc); + }) }); ``` diff --git a/package-lock.json b/package-lock.json index d148b87..5320246 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,7 +1,7 @@ { "name": "nano", "version": "11.0.0", - "lockfileVersion": 2, + "lockfileVersion": 3, "requires": true, "packages": { "": { @@ -69,43 +69,5 @@ "node": ">=14.0" } } - }, - "dependencies": { - "@types/node": { - "version": "20.6.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.6.2.tgz", - "integrity": "sha512-Y+/1vGBHV/cYk6OI1Na/LHzwnlNCAfU3ZNGrc1LdRe/LAIbdDPTTv/HU3M7yXN448aTVDq3eKRm2cg7iKLb8gw==", - "dev": true - }, - "busboy": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", - "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", - "dev": true, - "requires": { - "streamsearch": "^1.1.0" - } - }, - "streamsearch": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", - "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", - "dev": true - }, - "typescript": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", - "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", - "dev": true - }, - "undici": { - "version": "5.24.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.24.0.tgz", - "integrity": "sha512-OKlckxBjFl0oXxcj9FU6oB8fDAaiRUq+D8jrFWGmOfI/gIyjk/IeS75LMzgYKUaeHzLUcYvf9bbJGSrUwTfwwQ==", - "dev": true, - "requires": { - "busboy": "^1.6.0" - } - } } }