{"id":13454797,"url":"https://github.com/apache/couchdb-nano","last_synced_at":"2025-05-13T20:08:19.038Z","repository":{"id":34979709,"uuid":"39059221","full_name":"apache/couchdb-nano","owner":"apache","description":"Nano: The official Apache CouchDB library for Node.js","archived":false,"fork":false,"pushed_at":"2024-11-25T09:57:48.000Z","size":2311,"stargazers_count":668,"open_issues_count":39,"forks_count":163,"subscribers_count":30,"default_branch":"main","last_synced_at":"2025-05-08T15:36:59.790Z","etag":null,"topics":["apache","couchdb","nano","nodejs"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/nano","language":"JavaScript","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/apache.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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}},"created_at":"2015-07-14T07:00:05.000Z","updated_at":"2025-04-27T05:46:59.000Z","dependencies_parsed_at":"2023-11-15T10:29:48.068Z","dependency_job_id":"2d397591-a98c-4a6d-a255-f56b3409c5d8","html_url":"https://github.com/apache/couchdb-nano","commit_stats":{"total_commits":775,"total_committers":134,"mean_commits":"5.7835820895522385","dds":"0.47354838709677416","last_synced_commit":"8e1c24a06b5b48ef0e4390de206f7df4171ea91c"},"previous_names":[],"tags_count":167,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fcouchdb-nano","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fcouchdb-nano/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fcouchdb-nano/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fcouchdb-nano/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apache","download_url":"https://codeload.github.com/apache/couchdb-nano/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253852206,"owners_count":21973883,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["apache","couchdb","nano","nodejs"],"created_at":"2024-07-31T08:00:58.016Z","updated_at":"2025-05-13T20:08:18.990Z","avatar_url":"https://github.com/apache.png","language":"JavaScript","readme":"[![NPM](http://img.shields.io/npm/v/nano.svg?style=flat-square)](https://www.npmjs.com/package/nano)\n\n# Nano\n\nOffical [Apache CouchDB](https://couchdb.apache.org/) library for [Node.js](https://nodejs.org/).\n\nFeatures:\n\n* **Minimalistic** - There is only a minimum of abstraction between you and\n  CouchDB.\n* **Pipes** - Proxy requests from CouchDB directly to your end user. ( `...AsStream` functions only)\n* **Promises** - The vast majority of library calls return native Promises.\n* **TypeScript** - Detailed TypeScript definitions are built in.\n* **Errors** - Errors are proxied directly from CouchDB: if you know CouchDB\n  you already know `nano`.\n\n## Installation\n\n1. Install [npm][1]\n2. `npm install nano`\n\nor save `nano` as a dependency of your project with\n\n    npm install --save nano\n\nNote the minimum required version of Node.js is 10.\n\n## Table of contents\n\n- [Getting started](#getting-started)\n- [Tutorials \u0026 screencasts](#tutorials-examples-in-the-wild--screencasts)\n- [Configuration](#configuration)\n- [Database functions](#database-functions)\n  - [nano.db.create(name, [callback])](#nanodbcreatename-callback)\n  - [nano.db.get(name, [callback])](#nanodbgetname-callback)\n  - [nano.db.destroy(name, [callback])](#nanodbdestroyname-callback)\n  - [nano.db.list([callback])](#nanodblistcallback)\n  - [nano.db.listAsStream()](#nanodblistasstream)\n  - [nano.db.compact(name, [designname], [callback])](#nanodbcompactname-designname-callback)\n  - [nano.db.replicate(source, target, [opts], [callback])](#nanodbreplicatesource-target-opts-callback)\n  - [nano.db.replication.enable(source, target, [opts], [callback])](#nanodbreplicationenablesource-target-opts-callback)\n  - [nano.db.replication.query(id, [opts], [callback])](#nanodbreplicationenablesource-target-opts-callback)\n  - [nano.db.replication.disable(id, [opts], [callback])](#nanodbreplicationdisableid-opts-callback)\n  - [nano.db.changes(name, [params], [callback])](#nanodbchangesname-params-callback)\n  - [nano.db.changesAsStream(name, [params])](#nanodbchangesasstreamname-params)\n  - [nano.db.info([callback])](#nanodbinfocallback)\n  - [nano.use(name)](#nanousename)\n  - [nano.request(opts, [callback])](#nanorequestopts-callback)\n  - [nano.config](#nanoconfig)\n  - [nano.updates([params], [callback])](#nanoupdatesparams-callback)\n  - [nano.info([callback])](#nanoinfocallback)\n\n- [Document functions](#document-functions)\n  - [db.insert(doc, [params], [callback])](#dbinsertdoc-params-callback)\n  - [db.destroy(docname, rev, [callback])](#dbdestroydocname-rev-callback)\n  - [db.get(docname, [params], [callback])](#dbgetdocname-params-callback)\n  - [db.head(docname, [callback])](#dbheaddocname-callback)\n  - [db.bulk(docs, [params], [callback])](#dbbulkdocs-params-callback)\n  - [db.list([params], [callback])](#dblistparams-callback)\n  - [db.listAsStream([params])](#dblistasstreamparams)\n  - [db.fetch(docnames, [params], [callback])](#dbfetchdocnames-params-callback)\n  - [db.fetchRevs(docnames, [params], [callback])](#dbfetchrevsdocnames-params-callback)\n  - [db.createIndex(indexDef, [callback])](#dbcreateindexindexdef-callback)\n  - [db.changesReader](#reading-changes-feed)\n- [Partitioned database functions](#partition-functions)\n  - [db.partitionInfo(partitionKey, [callback])](#dbpartitioninfopartitionkey-callback))\n  - [db.partitionedList(partitionKey, [params], [callback])](#dbpartitionedlistpartitionkey-params-callback)\n  - [db.partitionedListAsStream(partitionKey, [params])](#dbpartitionedlistasstreampartitionkey-params)\n  - [db.partitionedFind(partitionKey, query, [callback])](#dbpartitionedfindpartitionkey-query-params)\n  - [db.partitionedFindAsStream(partitionKey, query)](#dbpartitionedfindasstreampartitionkey-query)\n  - [db.partitionedSearch(partitionKey, designName, searchName, params, [callback])](#dbpartitionedsearchpartitioney-designname-searchname-params-callback)\n  - [db.partitionedSearchAsStream(partitionKey, designName, searchName, params)](#dbpartitionedsearchasstreampartitionkey-designName-searchName-params)\n  - [db.partitionedView(partitionKey, designName, viewName, [params], [callback])](#dbpartitionediewpartitionkey-designname-viewname-params-callback)\n  - [db.partitionedViewAsStream(partitionKey, designName, viewName, [params])](#dbpartitionediewasstreampartitionkey-designname-viewname-params)\n- [Multipart functions](#multipart-functions)\n  - [db.multipart.insert(doc, attachments, [params], [callback])](#dbmultipartinsertdoc-attachments-params-callback)\n  - [db.multipart.get(docname, [params], [callback])](#dbmultipartgetdocname-params-callback)\n- [Attachments functions](#attachments-functions)\n  - [db.attachment.insert(docname, attname, att, contenttype, [params], [callback])](#dbattachmentinsertdocname-attname-att-contenttype-params-callback)\n  - [db.attachment.insertAsStream(docname, attname, att, contenttype, [params])](#dbattachmentinsertasstreamdocname-attname-att-contenttype-params)\n  - [db.attachment.get(docname, attname, [params], [callback])](#dbattachmentgetdocname-attname-params-callback)\n  - [db.attachment.getAsStream(docname, attname, [params])](#dbattachmentgetasstreamdocname-attname-params)\n  - [db.attachment.destroy(docname, attname, [params], [callback])](#dbattachmentdestroydocname-attname-params-callback)\n- [Views and design functions](#views-and-design-functions)\n  - [db.view(designname, viewname, [params], [callback])](#dbviewdesignname-viewname-params-callback)\n  - [db.viewAsStream(designname, viewname, [params])](#dbviewasstreamdesignname-viewname-params)\n  - [db.viewWithList(designname, viewname, listname, [params])](#dbviewwithlistdesignname-viewname-params)\n  - [db.viewWithListAsStream(designname__viewname, listname, [params])](#dbviewwithlistasstreamdesignname-viewname-params)\n  - [db.show(designname, showname, doc_id, [params], [callback])](#dbshowdesignname-showname-doc_id-params-callback)\n  - [db.atomic(designname, updatename, docname, [body], [callback])](#dbatomicdesignname-updatename-docname-body-callback)\n  - [db.search(designname, viewname, params, [callback])](#dbsearchdesignname-searchname-params-callback)\n  - [db.searchAsStream(designname, viewname, params)](#dbsearchasstreamdesignname-searchname-params)\n  - [db.find(selector, [callback])](#dbfindselector-callback)\n  - [db.findAsStream(selector)](#dbfindasstreamselector)\n- [Using cookie authentication](#using-cookie-authentication)\n- [Advanced features](#advanced-features)\n  - [getting uuids](#getting-uuids)\n  - [extending nano](#extending-nano)\n  - [pipes](#pipes)\n- [Tests](#tests)\n- [Release](#release)\n\n## Getting started\n\nTo use `nano` you need to connect it to your CouchDB install, to do that:\n\n```js\nconst nano = require('nano')('http://localhost:5984');\n```\n\n\u003e Note: Supplying authentication credentials in the URL e.g. `http://admin:mypassword@localhost:5984` is deprecated. Use `nano.auth` instead.\n\nTo create a new database:\n\n```js\nnano.db.create('alice');\n```\n\nand to use an existing database:\n\n```js\nconst alice = nano.db.use('alice');\n```\n\nUnder-the-hood, calls like `nano.db.create` are making HTTP API calls to the CouchDB service. Such operations are *asynchronous*. There are two ways to receive the asynchronous data back from the library\n\n1) Promises\n\n```js\nnano.db.create('alice').then((data) =\u003e {\n  // success - response is in 'data'\n}).catch((err) =\u003e {\n  // failure - error information is in 'err'\n})\n```\n\nor in the async/await style:\n\n```js\ntry {\n  const response = await nano.db.create('alice')\n  // succeeded\n  console.log(response)\n} catch (e) {\n  // failed\n  console.error(e)\n}\n```\n\n2) Callbacks\n\n```js\nnano.db.create('alice', (err, data) =\u003e {\n  // errors are in 'err' \u0026 response is in 'data'\n})\n```\n\nIn `nano` the callback function receives always three arguments:\n\n* `err` - The error, if any.\n* `body` - The HTTP _response body_ from CouchDB, if no error.\n  JSON parsed body, binary for non JSON responses.\n* `header` - The HTTP _response header_ from CouchDB, if no error.\n\nThe documentation will follow the *async/await* style.\n\n------------------\n\n\nA simple but complete example in the [async/await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function) style:\n\n```js\nasync function asyncCall() {\n  await nano.db.destroy('alice')\n  await nano.db.create('alice')\n  const alice = nano.use('alice')\n  const response = await alice.insert({ happy: true }, 'rabbit')\n  return response\n}\nasyncCall()\n```\n\nRunning this example will produce:\n\n```\nyou have inserted a document with an _id of rabbit.\n{ ok: true,\n  id: 'rabbit',\n  rev: '1-6e4cb465d49c0368ac3946506d26335d' }\n```\n\nYou can also see your document in futon (http://localhost:5984/_utils).\n\n## Configuration\n\nConfiguring nano to use your database server is as simple as:\n\n```js\nconst nano = require('nano')('http://localhost:5984')\nconst db = nano.use('foo');\n```\n\nIf you don't need to instrument database objects you can simply:\n\n```js\n// nano parses the URL and knows this is a database\nconst db = require('nano')('http://localhost:5984/foo');\n```\n\nYou can also pass options to the require to specify further configuration options you can pass an object literal instead:\n\n```js\n// nano parses the URL and knows this is a database\nconst opts = {\n  url: 'http://localhost:5984/foo',\n  requestDefaults: {\n    proxy: {\n      protocol: 'http',\n      host: 'myproxy.net'\n    },\n    headers: {\n      customheader: 'MyCustomHeader'\n    }\n  }\n};\nconst db = require('nano')(opts);\n```\n\nNano works perfectly well over HTTPS as long as the SSL cert is signed by a certification authority known by your client operating system. If you have a custom or self-signed certificate, you may need to create your own HTTPS agent and pass it to Nano e.g.\n\n```js\nconst httpsAgent = new https.Agent({\n  ca: '/path/to/cert',\n  rejectUnauthorized: true,\n  keepAlive: true,\n  maxSockets: 6\n})\nconst nano = Nano({\n  url: process.env.COUCH_URL,\n  requestDefaults: {\n    agent: httpsAgent,\n  }\n})\n```\n\nPlease check [axios] for more information on the defaults. They support features like proxies, timeout etc.\n\nYou can tell nano to not parse the URL (maybe the server is behind a proxy, is accessed through a rewrite rule or other):\n\n```js\n// nano does not parse the URL and return the server api\n// \"http://localhost:5984/prefix\" is the CouchDB server root\nconst couch = require('nano')(\n  { url : \"http://localhost:5984/prefix\"\n    parseUrl : false\n  });\nconst db = couch.use('foo');\n```\n\n### Pool size and open sockets\n\nA very important configuration parameter if you have a high traffic website and are using `nano` is the HTTP pool size. By default, the Node.js HTTP global agent has a infinite number of active connections that can run simultaneously. This can be limited to user-defined number (`maxSockets`) of requests that are \"in flight\", while others are kept in a queue. Here's an example explicitly using the Node.js HTTP agent configured with [custom options](https://nodejs.org/api/http.html#http_new_agent_options):\n\n```js\nconst http = require('http')\nconst myagent = new http.Agent({\n  keepAlive: true,\n  maxSockets: 25\n})\n\nconst db = require('nano')({\n  url: 'http://localhost:5984/foo',\n  requestDefaults : {\n    agent : myagent\n  }\n});\n```\n\n## TypeScript\n\nThere is a full TypeScript definition included in the the *nano* package. Your TypeScript editor will show you hints as you write your code with the *nano* library with your own custom classes:\n\n```ts\nimport * as Nano  from 'nano'\n\nlet n = Nano('http://USERNAME:PASSWORD@localhost:5984')\nlet db = n.db.use('people')\n\ninterface iPerson extends Nano.MaybeDocument {\n  name: string,\n  dob: string\n}\n\nclass Person implements iPerson {\n  _id: string\n  _rev: string\n  name: string\n  dob: string\n\n  constructor(name: string, dob: string) {\n    this._id = undefined\n    this._rev = undefined\n    this.name = name\n    this.dob = dob\n  }\n\n  processAPIResponse(response: Nano.DocumentInsertResponse) {\n    if (response.ok === true) {\n      this._id = response.id\n      this._rev = response.rev\n    }\n  }\n}\n\nlet p = new Person('Bob', '2015-02-04')\ndb.insert(p).then((response) =\u003e {\n  p.processAPIResponse(response)\n  console.log(p)\n})\n```\n\n## Database functions\n\n### nano.db.create(name, [opts], [callback])\n\nCreates a CouchDB database with the given `name`, with options `opts`.\n\n```js\nawait nano.db.create('alice', { n: 3 })\n```\n\n### nano.db.get(name, [callback])\n\nGet information about the database `name`:\n\n```js\nconst info = await nano.db.get('alice')\n```\n\n### nano.db.destroy(name, [callback])\n\nDestroys the database `name`:\n\n```js\nawait nano.db.destroy('alice')\n```\n\n### nano.db.list([callback])\n\nLists all the CouchDB databases:\n\n```js\nconst dblist = await nano.db.list()\n```\n\n### nano.db.listAsStream()\n\nLists all the CouchDB databases as a stream:\n\n```js\nnano.db.listAsStream()\n  .on('error', (e) =\u003e console.error('error', e))\n  .pipe(process.stdout);\n```\n\n### nano.db.compact(name, [designname], [callback])\n\nCompacts `name`, if `designname` is specified also compacts its views.\n\n### nano.db.replicate(source, target, [opts], [callback])\n\nReplicates `source` to `target` with options `opts`. The `target`database\nhas to exist, add `create_target:true` to `opts` to create it prior to\nreplication:\n\n```js\nconst response = await nano.db.replicate('alice',\n                  'http://admin:password@otherhost.com:5984/alice',\n                  { create_target:true })\n```\n\n### nano.db.replication.enable(source, target, [opts], [callback])\n\nEnables replication using the new CouchDB api from `source` to `target`\nwith options `opts`. `target` has to exist, add `create_target:true` to\n`opts` to create it prior to replication. Replication will survive server restarts.\n\n```js\nconst response = await nano.db.replication.enable('alice',\n                  'http://admin:password@otherhost.com:5984/alice',\n                  { create_target:true })\n```\n\n### nano.db.replication.query(id, [opts], [callback])\n\nQueries the state of replication using the new CouchDB API. The `id` comes from the response\ngiven by the call to `replication.enable`:\n\n```js\nconst r = await nano.db.replication.enable('alice',\n                  'http://admin:password@otherhost.com:5984/alice',\n                   { create_target:true })\nconst q = await nano.db.replication.query(r.id)\n```\n\n### nano.db.replication.disable(id, [opts], [callback])\n\nDisables replication using the new CouchDB API. The `id` comes from the response given\nby the call to `replication.enable`:\n\n```js\nconst r = await nano.db.replication.enable('alice',\n                   'http://admin:password@otherhost.com:5984/alice',\n                   { create_target:true })\nawait nano.db.replication.disable(r.id);\n```\n\n### nano.db.changes(name, [params], [callback])\n\nAsks for the changes feed of `name`, `params` contains additions\nto the query string.\n\n```js\nconst c = await nano.db.changes('alice')\n```\n\n### nano.db.changesAsStream(name, [params])\n\nSame as `nano.db.changes` but returns a stream.\n\n```js\nnano.db.changes('alice').pipe(process.stdout);\n```\n\n### nano.db.info([callback])\n\nGets database information:\n\n```js\nconst info = await nano.db.info()\n```\n\n### nano.use(name)\n\nReturns a database object that allows you to perform operations against that database:\n\n```js\nconst alice = nano.use('alice');\nawait alice.insert({ happy: true }, 'rabbit')\n```\n\nThe database object can be used to access the [Document Functions](#document-functions).\n\n### nano.db.use(name)\n\nAlias for `nano.use`\n\n### nano.db.scope(name)\n\nAlias for `nano.use`\n\n### nano.scope(name)\n\nAlias for `nano.use`\n\n### nano.request(opts, [callback])\n\nMakes a custom request to CouchDB. This can be used to create your own HTTP request to the CouchDB\nserver, to perform operations where there is no `nano` function that encapsulates it. The available `opts` are:\n\n* `opts.db` – the database name\n* `opts.method` – the http method, defaults to `get`\n* `opts.path` – the full path of the request, overrides `opts.doc` and\n  `opts.att`\n* `opts.doc` – the document name\n* `opts.att` – the attachment name\n* `opts.qs` – query string parameters, appended after any existing `opts.path`, `opts.doc`, or `opts.att`\n* `opts.content_type` – the content type of the request, default to `json`\n* `opts.headers` – additional http headers, overrides existing ones\n* `opts.body` – the document or attachment body\n* `opts.encoding` – the encoding for attachments\n* `opts.multipart` – array of objects for multipart request\n* `opts.stream` - if `true`, a `request` object is returned. Default `false` and a Promise is returned.\n\n### nano.relax(opts, [callback])\n\nAlias for `nano.request`\n\n### nano.config\n\nAn object containing the `nano` configurations, possible keys are:\n\n* `url` - the CouchDB URL\n* `db` - the database name\n\n### nano.updates([params], [callback])\n\nListen to db updates, the available `params` are:\n\n* `params.feed` – Type of feed. Can be one of\n * `longpoll`: Closes the connection after the first event.\n * `continuous`: Send a line of JSON per event. Keeps the socket open until timeout.\n * `eventsource`: Like, continuous, but sends the events in EventSource format.\n* `params.timeout` – Number of seconds until CouchDB closes the connection. Default is 60.\n* `params.heartbeat` – Whether CouchDB will send a newline character (\\n) on timeout. Default is true.\n\n### nano.info([callback])\n\nFetch information about the CouchDB cluster:\n\n```js\nconst info = await nano.info()\n```\n\nThe response is an object with [CouchDB cluster information](https://docs.couchdb.org/en/stable/intro/api.html#server).\n\n## Document functions\n\n### db.insert(doc, [params], [callback])\n\nInserts `doc` in the database with optional `params`. If params is a string, it's assumed it is the intended document `_id`. If params is an object, it's passed as query string parameters and `docName` is checked for defining the document `_id`:\n\n```js\nconst alice = nano.use('alice');\nconst response = await alice.insert({ happy: true }, 'rabbit')\n```\n\nThe `insert` function can also be used with the method signature `db.insert(doc,[callback])`, where the `doc` contains the `_id` field e.g.\n\n```js\nconst alice = nano.use('alice')\nconst response = await alice.insert({ _id: 'myid', happy: true })\n```\n\nand also used to update an existing document, by including the `_rev` token in the document being saved:\n\n```js\nconst alice = nano.use('alice')\nconst response = await alice.insert({ _id: 'myid', _rev: '1-23202479633c2b380f79507a776743d5', happy: false })\n```\n\n### db.destroy(docname, rev, [callback])\n\nRemoves a document from CouchDB whose `_id` is `docname` and whose revision (`_rev`) is `rev`:\n\n```js\nconst response = await alice.destroy('rabbit', '3-66c01cdf99e84c83a9b3fe65b88db8c0')\n```\n\n### db.get(docname, [params], [callback])\n\nGets a document from CouchDB whose `_id` is `docname`:\n\n```js\nconst doc = await alice.get('rabbit')\n```\n\nor with optional [query string `params`](https://docs.couchdb.org/en/stable/api/document/common.html#get--db-docid):\n\n```js\nconst doc = await alice.get('rabbit', { revs_info: true })\n```\n\nIf you pass `attachments=true`, the `doc._attachments.attachmentNameN.data` fields will contain the \n[base-64 encoded attachments](https://docs.couchdb.org/en/stable/json-structure.html#document-with-attachments).\nOr, you can use [`db.multipart.get`](https://github.com/DougReeder/couchdb-nano#dbmultipartgetdocname-params-callback)\nand parse the returned buffer to get the document and attachments.\n\nSee the [attachments methods](https://github.com/apache/couchdb-nano#attachments-functions) to retrieve\n*just* an attachment.\n\n### db.head(docname, [callback])\n\nSame as `get` but lightweight version that returns headers only:\n\n```js\nconst headers = await alice.head('rabbit')\n```\n\n*Note:* if you call `alice.head` in the callback style, the headers are returned to you as the third argument of the callback function.\n\n### db.bulk(docs, [params], [callback])\n\nBulk operations(update/delete/insert) on the database, refer to the\n[CouchDB doc](https://docs.couchdb.org/en/stable/api/database/bulk-api.html#post--db-_bulk_docs) e.g:\n\n```js\nconst documents = [\n  { a:1, b:2 },\n  { _id: 'tiger', striped: true}\n];\nconst response = await alice.bulk({ docs: documents })\n```\n\n### db.list([params], [callback])\n\nList all the docs in the database .\n\n```js\nconst doclist = await alice.list().then((body)=\u003e{\n    body.rows.forEach((doc) =\u003e {\n        console.log(doc);\n    })\n});\n```\n\nor with optional query string additions `params`:\n\n```js\nconst doclist = await alice.list({include_docs: true})\n```\n\n### db.listAsStream([params])\n\nList all the docs in the database as a stream.\n\n```js\nalice.listAsStream()\n  .on('error', (e) =\u003e console.error('error', e))\n  .pipe(process.stdout)\n```\n\n### db.fetch(docnames, [params], [callback])\n\nBulk fetch of the database documents, `docnames` are specified as per\n[CouchDB doc](https://docs.couchdb.org/en/latest/api/database/bulk-api.html#post--db-_all_docs).\nadditional query string `params` can be specified, `include_docs` is always set\nto `true`.\n\n```js\nconst keys = ['tiger', 'zebra', 'donkey'];\nconst datat = await alice.fetch({keys: keys})\n```\n\n### db.fetchRevs(docnames, [params], [callback])\n\n** changed in version 6 **\n\nBulk fetch of the revisions of the database documents, `docnames` are specified as per\n[CouchDB doc](https://docs.couchdb.org/en/latest/api/database/bulk-api.html#post--db-_all_docs).\nadditional query string `params` can be specified, this is the same method as fetch but\n `include_docs` is not automatically set to `true`.\n\n### db.createIndex(indexDef, [callback])\n\nCreate index on database fields, as specified in\n[CouchDB doc](https://docs.couchdb.org/en/latest/api/database/find.html#db-index).\n\n```js\nconst indexDef = {\n  index: { fields: ['foo'] },\n  name: 'fooindex'\n};\nconst response = await alice.createIndex(indexDef)\n```\n\n## Reading Changes Feed\n\nNano provides a low-level API for making calls to CouchDB's changes feed, or if you want a \nreliable, resumable changes feed follower, then you need the `changesReader`.\n\nThere are three ways to start listening to the changes feed:\n\n1. `changesReader.start()` - to listen to changes indefinitely by repeated \"long poll\" requests. This mode continues to poll for changes until `changesReader.stop()` is called, at which point any active long poll will be canceled.\n2. `changesReader.get()` - to listen to changes until the end of the changes feed is reached, by repeated \"long poll\" requests. Once a response with zero changes is received, the 'end' event will indicate the end of the changes and polling will stop.\n3. `changesReader.spool()` - listen to changes in one long HTTP request. (as opposed to repeated round trips) - spool is faster but less reliable.\n\n\u003e Note: for `.get()` \u0026 `.start()`, the sequence of API calls can be paused by calling `changesReader.pause()` and resumed by calling `changesReader.resume()`.\n\nSet up your database connection and then choose `changesReader.start()` to listen to that database's changes:\n\n```js\nconst db = nano.db.use('mydb')\ndb.changesReader.start()\n  .on('change', (change) =\u003e { console.log(change) })\n  .on('batch', (b) =\u003e {\n    console.log('a batch of', b.length, 'changes has arrived');\n  }).on('seq', (s) =\u003e {\n    console.log('sequence token', s);\n  }).on('error', (e) =\u003e {\n    console.error('error', e);\n  })\n```\n\n\u003e Note: you probably want to monitor *either* the `change` or `batch` event, not both.\n\nIf you want `changesReader` to hold off making the next `_changes` API call until you are ready, then supply `wait:true` in the options to `get`/`start`. The next request will only fire when you call `changesReader.resume()`:\n\n```js\ndb.changesReader.get({wait: true})\n  .on('batch', (b) =\u003e {\n    console.log('a batch of', b.length, 'changes has arrived');\n    // do some asynchronous work here and call \"changesReader.resume()\"\n    // when you're ready for the next API call to be dispatched.\n    // In this case, wait 5s before the next changes feed request.\n    setTimeout( () =\u003e {\n      db.changesReader.resume()\n    }, 5000)\n  }).on('end', () =\u003e {\n    console.log('changes feed monitoring has stopped');\n  });\n```\n\nYou may supply a number of options when you start to listen to the changes feed:\n\n| Parameter | Description                                                                                                                                                                             | Default value | e.g.                            |   |\n|-----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|---------------------------------|---|\n| batchSize | The maximum number of changes to ask CouchDB for per HTTP request. This is the maximum number of changes you will receive in a `batch` event. | 100           | 500                             |   |\n| since     | The position in the changes feed to start from where `0` means the beginning of time, `now` means the current position or a string token indicates a fixed position in the changes feed | now           | 390768-g1AAAAGveJzLYWBgYMlgTmGQ |   |\n| includeDocs | Whether to include document bodies or not | false | e.g. true |\n| wait | For `get`/`start` mode, automatically pause the changes reader after each request. When the the user calls `resume()`, the changes reader will resume.  | false | e.g. true |\n| fastChanges | Adds a seq_interval parameter to fetch changes more quickly | false           | true                             |   |\n| selector | Filters the changes feed with the supplied Mango selector |    null       | {\"name\":\"fred}                            |   |\n| timeout | The number of milliseconds a changes feed request waits for data| 60000         | 10000    |\n\nThe events it emits are as follows:s\n\n| Event  | Description                                                                                                                                                               | Data                       |   |\n|--------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------|---|\n| change | Each detected change is emitted individually. Only available in `get`/`start` modes.                                                                                                                          | A change object            |   |\n| batch  | Each batch of changes is emitted in bulk in quantities up to `batchSize`.                                                                                                                              | An array of change objects |   |\n| seq    | Each new sequence token (per HTTP request). This token can be passed into `ChangesReader` as the `since` parameter to resume changes feed consumption from a known point. Only available in `get`/`start` modes. | String                     |   |\n| error  | On a fatal error, a descriptive object is returned and change consumption stops.                                                                                         | Error object               |   |\n| end    | Emitted when the end of the changes feed is reached. `ChangesReader.get()` mode only,                                                                                     | Nothing                    |   |\n\nThe *ChangesReader* library will handle many temporal errors such as network connectivity, service capacity limits and malformed data but it will emit an `error` event and exit when fed incorrect authentication credentials or an invalid `since` token.\n\nThe `change` event delivers a change object that looks like this:\n\n```js\n{\n\t\"seq\": \"8-g1AAAAYIeJyt1M9NwzAUBnALKiFOdAO4gpRix3X\",\n\t\"id\": \"2451be085772a9e588c26fb668e1cc52\",\n\t\"changes\": [{\n\t\t\"rev\": \"4-061b768b6c0b6efe1bad425067986587\"\n\t}],\n\t\"doc\": {\n\t\t\"_id\": \"2451be085772a9e588c26fb668e1cc52\",\n\t\t\"_rev\": \"4-061b768b6c0b6efe1bad425067986587\",\n\t\t\"a\": 3\n\t}\n}\n```\n\nN.B\n\n- `doc` is only present if `includeDocs:true` is supplied\n- `seq` is not present for every change\n\nThe `id` is the unique identifier of the document that changed and the `changes` array contains the document revision tokens that were written to the database.\n\nThe `batch` event delivers an array of change objects.\n\n## Partition Functions\n\nFunctions related to [partitioned databases](https://docs.couchdb.org/en/latest/partitioned-dbs/index.html).\n\nCreate a partitioned database by passing `{ partitioned: true }` to `db.create`:\n\n```js\nawait nano.db.create('my-partitioned-db', { partitioned: true })\n```\n\nThe database can be used as normal:\n\n```js\nconst db = nano.db.use('my-partitioned-db')\n```\n\nbut documents must have a two-part `_id` made up of `\u003cpartition key\u003e:\u003cdocument id\u003e`. They are insert with `db.insert` as normal:\n\n```js\nconst doc = { _id: 'canidae:dog', name: 'Dog', latin: 'Canis lupus familiaris' }\nawait db.insert(doc)\n```\n\nDocuments can be retrieved by their `_id` using `db.get`:\n\n```js\nconst doc = db.get('canidae:dog')\n```\n\nMango indexes can be created to operate on a per-partition index by supplying `partitioned: true` on creation:\n\n```js\nconst i = {\n  ddoc: 'partitioned-query',\n  index: { fields: ['name'] },\n  name: 'name-index',\n  partitioned: true,\n  type: 'json'\n}\n\n// instruct CouchDB to create the index\nawait db.index(i)\n```\n\nSearch indexes can be created by writing a design document with `opts.partitioned = true`:\n\n```js\n// the search definition\nconst func = function(doc) {\n  index('name', doc.name)\n  index('latin', doc.latin)\n}\n\n// the design document containing the search definition function\nconst ddoc = {\n  _id: '_design/search-ddoc',\n  indexes: {\n    search-index: {\n      index: func.toString()\n    }\n  },\n  options: {\n    partitioned: true\n  }\n}\n \nawait db.insert(ddoc)\n```\n\nMapReduce views can be created by writing a design document with `opts.partitioned = true`:\n\n```js\nconst func = function(doc) {\n  emit(doc.family, doc.weight)\n}\n\n// Design Document\nconst ddoc = {\n  _id: '_design/view-ddoc',\n  views: {\n    family-weight: {\n      map: func.toString(),\n      reduce: '_sum'\n    }\n  },\n  options: {\n    partitioned: true\n  }\n}\n\n// create design document\nawait db.insert(ddoc)\n```\n\n### db.partitionInfo(partitionKey, [callback])\n\nFetch the stats of a single partition:\n\n```js\nconst stats = await alice.partitionInfo('canidae')\n```\n\n### db.partitionedList(partitionKey, [params], [callback])\n\nFetch documents from a database partition:\n\n```js\n// fetch document id/revs from a partition\nconst docs = await alice.partitionedList('canidae')\n\n// add document bodies but limit size of response\nconst docs = await alice.partitionedList('canidae', { include_docs: true, limit: 5 })\n```\n\n### db.partitionedListAsStream(partitionKey, [params])\n\nFetch documents from a partition as a stream:\n\n```js\n// fetch document id/revs from a partition\nnano.db.partitionedListAsStream('canidae')\n  .on('error', (e) =\u003e console.error('error', e))\n  .pipe(process.stdout)\n\n// add document bodies but limit size of response\nnano.db.partitionedListAsStream('canidae', { include_docs: true, limit: 5 })\n  .on('error', (e) =\u003e console.error('error', e))\n  .pipe(process.stdout)\n```\n\n### db.partitionedFind(partitionKey, query, [params])\n\nQuery documents from a partition by supplying a Mango selector:\n\n```js\n// find document whose name is 'wolf' in the 'canidae' partition\nawait db.partitionedFind('canidae', { 'selector' : { 'name': 'Wolf' }})\n```\n\n### db.partitionedFindAsStream(partitionKey, query)\n\nQuery documents from a partition by supplying a Mango selector as a stream:\n\n```js\n// find document whose name is 'wolf' in the 'canidae' partition\ndb.partitionedFindAsStream('canidae', { 'selector' : { 'name': 'Wolf' }})\n  .on('error', (e) =\u003e console.error('error', e))\n  .pipe(process.stdout)\n```\n\n### db.partitionedSearch(partitionKey, designName, searchName, params, [callback])\n\nSearch documents from a partition by supplying a Lucene query:\n\n```js\nconst params = {\n  q: 'name:\\'Wolf\\''\n}\nawait db.partitionedSearch('canidae', 'search-ddoc', 'search-index', params)\n// { total_rows: ... , bookmark: ..., rows: [ ...] }\n```\n\n### db.partitionedSearchAsStream(partitionKey, designName, searchName, params)\n\nSearch documents from a partition by supplying a Lucene query as a stream:\n\n```js\nconst params = {\n  q: 'name:\\'Wolf\\''\n}\ndb.partitionedSearchAsStream('canidae', 'search-ddoc', 'search-index', params)\n  .on('error', (e) =\u003e console.error('error', e))\n  .pipe(process.stdout)\n// { total_rows: ... , bookmark: ..., rows: [ ...] }\n```\n\n### db.partitionedView(partitionKey, designName, viewName, params, [callback])\n\nFetch documents from a MapReduce view from a partition:\n\n```js\nconst params = {\n  startkey: 'a',\n  endkey: 'b',\n  limit: 1\n}\nawait db.partitionedView('canidae', 'view-ddoc', 'view-name', params)\n// { rows: [ { key: ... , value: [Object] } ] }\n```\n\n### db.partitionedViewAsStream(partitionKey, designName, viewName, params)\n\nFetch documents from a MapReduce view from a partition as a stream:\n\n```js\nconst params = {\n  startkey: 'a',\n  endkey: 'b',\n  limit: 1\n}\ndb.partitionedViewAsStream('canidae', 'view-ddoc', 'view-name', params)\n  .on('error', (e) =\u003e console.error('error', e))\n  .pipe(process.stdout)\n// { rows: [ { key: ... , value: [Object] } ] }\n```\n\n## Multipart functions\n\n### db.multipart.insert(doc, attachments, params, [callback])\n\nInserts a `doc` together with `attachments` and `params`. If params is a string, it's assumed as the intended document `_id`. If params is an object, its passed as query string parameters and `docName` is checked for defining the `_id`. Refer to the [doc](https://docs.couchdb.org/en/stable/api/document/common.html) for more details.\n The `attachments` parameter must be an array of objects with `name`, `data` and `content_type` properties.\n\n```js\nconst fs = require('fs');\n\nfs.readFile('rabbit.png', (err, data) =\u003e {\n  if (!err) {\n    await alice.multipart.insert({ foo: 'bar' }, [{name: 'rabbit.png', data: data, content_type: 'image/png'}], 'mydoc')\n  }\n});\n```\n\n### db.multipart.get(docname, [params], [callback])\n\nGet `docname` together with its attachments via `multipart/related` request with optional [query string additions](https://docs.couchdb.org/en/stable/api/document/common.html#get--db-docid). The multipart response body is a `Buffer`.\n\n```js\nconst response = await alice.multipart.get('rabbit')\n```\n\n## Attachments functions\n\n### db.attachment.insert(docname, attname, att, contenttype, [params], [callback])\n\nInserts an attachment `attname` to `docname`, in most cases\n `params.rev` is required. Refer to the\n [CouchDB doc](https://docs.couchdb.org/en/latest/api/document/attachments.html#db-doc-attachment) for more details.\n\n```js\nconst fs = require('fs');\n\nfs.readFile('rabbit.png', (err, data) =\u003e {\n  if (!err) {\n    await alice.attachment.insert('rabbit', \n      'rabbit.png', \n      data, \n      'image/png',\n      { rev: '12-150985a725ec88be471921a54ce91452' })\n  }\n});\n```\n\n### db.attachment.insertAsStream(docname, attname, att, contenttype, [params])\n\nAs of Nano 9.x, the function `db.attachment.insertAsStream` is now deprecated. Now simply pass\na readable stream to `db.attachment.insert` as the third paramseter.\n\n### db.attachment.get(docname, attname, [params], [callback])\n\nGet `docname`'s attachment `attname` with optional query string additions\n`params`.\n\n```js\nconst fs = require('fs');\n\nconst body = await alice.attachment.get('rabbit', 'rabbit.png')\nfs.writeFile('rabbit.png', body)\n```\n\n### db.attachment.getAsStream(docname, attname, [params])\n\n```js\nconst fs = require('fs');\nalice.attachment.getAsStream('rabbit', 'rabbit.png')\n  .on('error', e =\u003e console.error)\n  .pipe(fs.createWriteStream('rabbit.png'));\n```\n\n### db.attachment.destroy(docname, attname, [params], [callback])\n\n**changed in version 6**\n\nDestroy attachment `attname` of `docname`'s revision `rev`.\n\n```js\nconst response = await alice.attachment.destroy('rabbit', 'rabbit.png', {rev: '1-4701d73a08ce5c2f2983bf7c9ffd3320'})\n```\n\n## Views and design functions\n\n### db.view(designname, viewname, [params], [callback])\n\nCalls a view of the specified `designname` with optional query string `params`. If you're looking to filter the view results by key(s) pass an array of keys, e.g\n`{ keys: ['key1', 'key2', 'key_n'] }`, as `params`.\n\n```js\nconst body = await alice.view('characters', 'happy_ones', { key: 'Tea Party', include_docs: true })\nbody.rows.forEach((doc) =\u003e {\n  console.log(doc.value)\n})\n```\n\nor\n\n```js\nconst body = await alice.view('characters', 'soldiers', { keys: ['Hearts', 'Clubs'] })\n```\n\nWhen `params` is not supplied, or no keys are specified, it will simply return all documents in the view:\n\n```js\nconst body = await alice.view('characters', 'happy_ones')\n```\n\n```js\nconst body = alice.view('characters', 'happy_ones', { include_docs: true })\n```\n\n### db.viewAsStream(designname, viewname, [params])\n\nSame as `db.view` but returns a stream:\n\n```js\nalice.viewAsStream('characters', 'happy_ones', {reduce: false})\n  .on('error', (e) =\u003e console.error('error', e))\n  .pipe(process.stdout);\n```\n\n### db.viewWithList(designname, viewname, listname, [params], [callback])\n\nCalls a list function fed by the given view from the specified design document.\n\n```js\nconst body = await alice.viewWithList('characters', 'happy_ones', 'my_list')\n```\n\n### db.viewWithListAsStream(designname, viewname, listname, [params], [callback])\n\nCalls a list function fed by the given view from the specified design document as a stream.\n\n```js\nalice.viewWithListAsStream('characters', 'happy_ones', 'my_list')\n  .on('error', (e) =\u003e console.error('error', e))\n  .pipe(process.stdout);\n```\n\n### db.show(designname, showname, doc_id, [params], [callback])\n\nCalls a show function from the specified design for the document specified by doc_id with\noptional query string additions `params`.\n\n```js\nconst doc = await alice.show('characters', 'format_doc', '3621898430')\n```\n\nTake a look at the [CouchDB wiki](https://guide.couchdb.org/draft/show.html)\nfor possible query paramaters and more information on show functions.\n\n### db.atomic(designname, updatename, docname, [body], [callback])\n\nCalls the design's update function with the specified doc in input.\n\n```js\nconst response = await db.atomic('update', 'inplace', 'foobar', {field: 'foo', value: 'bar'})\n```\n\nNote that the data is sent in the body of the request.\nAn example update handler follows:\n\n```js\n\"updates\": {\n  \"in-place\" : \"function(doc, req) {\n      var request_body = JSON.parse(req.body)\n      var field = request_body.field\n      var value = request_body.value\n      var message = 'set ' + field + ' to ' + value\n      doc[field] = value\n      return [doc, message]\n  }\"\n}\n```\n\n### db.search(designname, searchname, params, [callback])\n\nCalls a view of the specified design with optional query string additions `params`.\n\n```js\nconst response = await alice.search('characters', 'happy_ones', { q: 'cat' })\n```\n\nor\n\n```js\nconst drilldown = [['author', 'Dickens']['publisher','Penguin']]\nconst response = await alice.search('inventory', 'books', { q: '*:*', drilldown: drilldown })\n```\n\nCheck out the tests for a fully functioning example.\n\n### db.searchAsStream(designname, searchname, params)\n\nCalls a view of the specified design with optional query string additions `params`. Returns stream.\n\n```js\nalice.search('characters', 'happy_ones', { q: 'cat' }).pipe(process.stdout);\n```\n\n### db.find(selector, [callback])\n\nPerform a [\"Mango\" query](https://docs.couchdb.org/en/2.1.1/api/database/find.html) by supplying a JavaScript object containing a selector:\n\n```js\n// find documents where the name = \"Brian\" and age \u003e 25.\nconst q = {\n  selector: {\n    name: { \"$eq\": \"Brian\"},\n    age : { \"$gt\": 25 }\n  },\n  fields: [ \"name\", \"age\", \"tags\", \"url\" ],\n  limit:50\n};\nconst response = await alice.find(q)\n```\n\n### db.findAsStream(selector)\n\nPerform a [\"Mango\" query](http://docs.couchdb.org/en/2.1.1/api/database/find.html) by supplying a JavaScript object containing a selector, but return a stream:\n\n```js\n// find documents where the name = \"Brian\" and age \u003e 25.\nconst q = {\n  selector: {\n    name: { \"$eq\": \"Brian\"},\n    age : { \"$gt\": 25 }\n  },\n  fields: [ \"name\", \"age\", \"tags\", \"url\" ],\n  limit:50\n};\nalice.findAsStream(q)\n  .on('error', (e) =\u003e console.error('error', e))\n  .pipe(process.stdout);\n```\n\n## using cookie authentication\n\nNano supports making requests using CouchDB's [cookie authentication](http://guide.couchdb.org/editions/1/en/security.html#cookies) functionality. If you initialise *Nano* so that it is cookie-aware, you may call `nano.auth` first to get a session cookie. Nano will behave like a web browser, remembering your session cookie and refreshing it if a new one is received in a future HTTP response.\n\n```js\nconst nano = require('nano')({\n  url: 'http://localhost:5984',\n  requestDefaults: {\n    jar: true\n  }\n})\nconst username = 'user'\nconst userpass = 'pass'\nconst db = nano.db.use('mydb')\n\n// authenticate\nawait nano.auth(username, userpass)\n\n// requests from now on are authenticated\nconst doc = await db.get('mydoc')\nconsole.log(doc)\n```\n\nThe second request works because the `nano` library has remembered the `AuthSession` cookie that was invisibily returned by the `nano.auth` call.\n\nWhen you have a session, you can see what permissions you have by calling the `nano.session` function\n\n```js\nconst doc = await nano.session()\n// { userCtx: { roles: [ '_admin', '_reader', '_writer' ], name: 'rita' },  ok: true }\n```\n\n## Advanced features\n\n### Getting uuids\n\nIf your application needs to generate UUIDs, then CouchDB can provide some for you\n\n```js\nconst response = await nano.uuids(3)\n// { uuids: [\n// '5d1b3ef2bc7eea51f660c091e3dffa23',\n// '5d1b3ef2bc7eea51f660c091e3e006ff',\n// '5d1b3ef2bc7eea51f660c091e3e007f0',\n//]}\n```\n\nThe first parameter is the number of uuids to generate. If omitted, it defaults to 1.\n\n### Extending nano\n\n`nano` is minimalistic but you can add your own features with\n`nano.request(opts)`\n\nFor example, to create a function to retrieve a specific revision of the\n`rabbit` document:\n\n```js\nfunction getrabbitrev(rev) {\n  return nano.request({ db: 'alice',\n                 doc: 'rabbit',\n                 method: 'get',\n                 params: { rev: rev }\n               });\n}\n\ngetrabbitrev('4-2e6cdc4c7e26b745c2881a24e0eeece2').then((body) =\u003e {\n  console.log(body);\n});\n```\n\n### Pipes\n\nYou can pipe the return values of certain nano functions like other stream. For example if our `rabbit` document has an attachment with name `picture.png` you can pipe it to a `writable stream`:\n\n```js\nconst fs = require('fs');\nconst nano = require('nano')('http://127.0.0.1:5984/');\nconst alice = nano.use('alice');\nalice.attachment.getAsStream('rabbit', 'picture.png')\n  .on('error', (e) =\u003e console.error('error', e))\n  .pipe(fs.createWriteStream('/tmp/rabbit.png'));\n```\n\nthen open `/tmp/rabbit.png` and you will see the rabbit picture.\n\nFunctions that return streams instead of a Promise are:\n\n- nano.db.listAsStream\n\nattachment functions:\n\n- db.attachment.getAsStream\n- db.attachment.insertAsStream\n\nand document level functions\n\n- db.listAsStream\n\n### Logging\n\nWhen instantiating Nano, you may supply the function that will perform the logging of requests and responses. In its simplest for, simply pass `console.log` as your logger:\n\n```js\nconst nano = Nano({ url: process.env.COUCH_URL, log: console.log })\n// all requests and responses will be sent to console.log\n```\n\nYou may supply your own logging function to format the data before output:\n\n```js\nconst url = require('url')\nconst logger = (data) =\u003e {\n  // only output logging if there is an environment variable set\n  if (process.env.LOG === 'nano') {\n    // if this is a request\n    if (typeof data.err === 'undefined') {\n      const u = new url.URL(data.uri)\n      console.log(data.method, u.pathname, data.qs)\n    } else {\n      // this is a response\n      const prefix = data.err ? 'ERR' : 'OK'\n      console.log(prefix, data.headers.statusCode, JSON.stringify(data.body).length)\n    }\n  }\n}\nconst nano = Nano({ url: process.env.COUCH_URL, log: logger })\n// all requests and responses will be formatted by my code\n// GET /cities/_all_docs { limit: 5 }\n// OK 200 468\n```\n\n## Tutorials, examples in the wild \u0026 screencasts\n\n* article: [nano - a minimalistic CouchDB client for nodejs](https://writings.nunojob.com/2011/08/nano-minimalistic-couchdb-client-for-nodejs.html)\n* article: [getting started with Node.js and CouchDB](https://writings.nunojob.com/2011/09/getting-started-with-nodejs-and-couchdb.html)\n* article: [nano 3](https://writings.nunojob.com/2012/05/Nano-3.html)\n* article: [how to update a document with nano](https://writings.nunojob.com/2012/07/How-To-Update-A-Document-With-Nano-The-CouchDB-Client-for-Node.js.html)\n* article: [thoughts on development using CouchDB with Node.js](https://tbranyen.com/post/thoughts-on-development-using-couchdb-with-nodejs)\n* example in the wild: [nanoblog](https://github.com/grabbeh/nanoblog)\n\n## Roadmap\n\nCheck [issues][2]\n\n## Tests\n\nTo run (and configure) the test suite simply:\n\n``` sh\ncd nano\nnpm install\nnpm run test\n```\n\n## Meta\n\n* code: `git clone git://github.com/apache/couchdb-nano.git`\n* home: \u003chttps://github.com/apache/couchdb-nano\u003e\n* bugs: \u003chttps://github.com/apache/couchdb-nano/issues\u003e\n* chat: [Freenode IRC @ #couchdb-dev][8]\n\n[1]: https://npmjs.org\n[2]: https://github.com/apache/couchdb-nano/issues\n[4]: https://github.com/apache/couchdb-nano/blob/main/cfg/couch.example.js\n[8]: https://webchat.freenode.net?channels=%23couchdb-dev\n[axios]:  https://github.com/axios/axios\n\nhttps://freenode.org/\n\n## Release\n\nTo create a new release of nano. Run the following commands on the main branch\n\n```sh\n  npm version {patch|minor|major}\n  github push  origin main --tags\n  npm publish\n```\n","funding_links":[],"categories":["Packages","Repository","包","Database","Libraries and Clients","JavaScript","目录"],"sub_categories":["Database","数据库"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fcouchdb-nano","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapache%2Fcouchdb-nano","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fcouchdb-nano/lists"}