{"_id":"@budibase/nano","_rev":"14-2984453d72395000741ea04056f1953f","name":"@budibase/nano","dist-tags":{"latest":"10.1.6"},"versions":{"10.1.0":{"name":"@budibase/nano","version":"10.1.0","keywords":["couchdb","data","request","json","nosql","micro","nano","database"],"author":{"url":"http://couchdb.apache.org","name":"Apache CouchDB","email":"dev@couchdb.apache.org"},"license":"Apache-2.0","_id":"@budibase/nano@10.1.0","maintainers":[{"name":"mike_chuckles","email":"me@michaeldrury.co.uk"},{"name":"shogunpurple","email":"martin@budibase.com"}],"homepage":"http://github.com/apache/couchdb-nano","bugs":{"url":"https://github.com/apache/couchdb-nano/issues"},"dist":{"shasum":"fb571c245bf8424697937622fe0fc3c5d553c063","tarball":"https://registry.npmjs.org/@budibase/nano/-/nano-10.1.0.tgz","fileCount":18,"integrity":"sha512-mQCAlWA76vNqa5KM4j+wwF9RVyM9vuHwccQu/w/Un13jXiPL83Tmwo0eAXtlm+AtLthtQl5NfojqF+zCofepeA==","signatures":[{"sig":"MEUCIGlB3EbD9QvVRNgT1MHoYdFrSqb+0mt+fa7aAUG6E/MkAiEA+ZUv0WaQb2E42ddVdZrntU7vrOAfbOCePYSJGJm8Z1s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":181819,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmQbKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoblQ//Rjjhn/rfhKbVPIH0qavb/Flm7g89c5a3HmZN49MfBjura6mE\r\nogd6Gh5e72w6zW5gccTn1c4fiCxevu3uNT9KkQN4kkBT+2UDzdBCsvVs+Ljr\r\nh7vq9FcJNmOehkpNFpWrfNCxUtlMzVvzebNB5MIw4sx8mJy1MS2+QQRcGbMr\r\n04O2t63pqb/734zWkVQY5KN5uep7LYSO5PO62ZUM1Is9Ovc6kHN5ICMQi4Q9\r\n5npi25s/9x2AZqXftZ6Y3/Z6steqO5n1bq37IO0beOM+DOAhraGThmuab2BD\r\nGh37Spw7MSk8YxNwy7dCyH6T1CKRTTCmfnOuVAIWodjGrbzdP20QfRTJEIuc\r\nSHCcbD/olmj5lnla10iiLto7Uoumu5udbVjYW7cdcM28aR8BwVflFhNueaJ+\r\nyWK7GoEphzfwzv86SIAWP5VL/OrHhCW6uJonOJEtiqNaB4CpGDuUKyR7GLmB\r\n5NmqzeeSZQuxwkBJ3cYHwYW1TPI1qRlv91rC4nhxoBen+63q9wlxVKgkpm0a\r\n+7I3zCIdRb37OnM9d0+fJ5WhU3S/TUylABFBEbIHDXrGvfWLfraQyqoYiraY\r\nezIfOQSjyQOMqYko2QAl7d7y7yG+/OsWGlepLT9tExgjBpJnktNJz2rpEUw0\r\nHJry2exYLGXywXm7N4n/SkS/kogXMpxneAU=\r\n=hOA6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./lib/nano.js","types":"./lib/nano.d.ts","engines":{"node":">=14"},"gitHead":"f9d9633c1855382274c785b1eb66b73e7d319827","scripts":{"jest":"jest test/* --coverage --env node","test":"standard && tsc lib/nano.d.ts && npm run jest","standard":"standard --fix"},"_npmUser":{"name":"mike_chuckles","email":"me@michaeldrury.co.uk"},"standard":{"env":["jest"]},"pre-commit":["test"],"repository":{"url":"git+ssh://git@github.com/apache/couchdb-nano.git","type":"git"},"_npmVersion":"8.11.0","description":"The official CouchDB client for Node.js","directories":{},"_nodeVersion":"16.15.1","dependencies":{"qs":"^6.11.0","axios":"^1.1.3","tough-cookie":"^4.1.2","http-cookie-agent":"^4.0.2","@types/tough-cookie":"^4.0.2","node-abort-controller":"^3.0.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.2.2","nock":"^13.2.9","standard":"^17.0.0","typescript":"^4.8.4","@types/node":"^18.11.9"},"_npmOperationalInternal":{"tmp":"tmp/nano_10.1.0_1670973130731_0.6265365299089376","host":"s3://npm-registry-packages"}},"10.1.1":{"name":"@budibase/nano","version":"10.1.1","keywords":["couchdb","data","request","json","nosql","micro","nano","database"],"author":{"url":"http://couchdb.apache.org","name":"Apache CouchDB","email":"dev@couchdb.apache.org"},"license":"Apache-2.0","_id":"@budibase/nano@10.1.1","maintainers":[{"name":"mike_chuckles","email":"me@michaeldrury.co.uk"},{"name":"shogunpurple","email":"martin@budibase.com"}],"homepage":"http://github.com/apache/couchdb-nano","dist":{"shasum":"36ccda4d9bb64b5ee14dd2b27a295b40739b1038","tarball":"https://registry.npmjs.org/@budibase/nano/-/nano-10.1.1.tgz","fileCount":23,"integrity":"sha512-kbMIzMkjVtl+xI0UPwVU0/pn8/ccxTyfzwBz6Z+ZiN2oUSb0fJCe0qwA6o8dxwSa8nZu4MbGAeMJl3CJndmWtA==","signatures":[{"sig":"MEQCIHdW6ex1NjMgrlNOjXryvJ5ACfrbudOxS3Ltw3j8J4BwAiBCEXhhJNCq1TqW8H652gGC9nCLzZ8XdxoN6+LWatbpaA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":181819,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmQ6JACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpWXQ//ULoRhe76qsxfm1AnfrPNfxsSWB4ndjhaIT/TH6tp5/YHm65f\r\nQWJ82ccQlgLiv/wb8VDb8ALEGZwvtr3GZUUNjHE9ChqeYO/HE/Pds15+GMPY\r\n7El2IUpJZUBXjagPQqUOA93zavfIhLRLyOSrFxQ3YjYQgJDvaeoXRyLW4X/Y\r\nNEGuUB5CDgFQrBRgwHzcIELMGExnjmpemis+k4AkqUkkd77FRXBNLl75lQoK\r\nJsVPrUt/BUqnpUF3IUaijM6UccNGNaAiEdZNeihiR0Vji2qguIpnYHQeeiVq\r\namgJwGFagIcGSkMMblOQtdHPK9WKfMMmrd34lLBw5TM9K6BdSAPG+Ex9lfHp\r\n0baqSQRnNmeWSllG0bo9A8LtidLsNImv9IWIhieo1gKkbhowtBx15KLFTU2V\r\nMVfduTZkdXP7ugoVlHQWhb7eMTOJg313cH4rg66IAubELAPoooG8dMj9Ljss\r\nbhC7nH4H/ciOxUNAuevSlhY3T4r4XhFNIsEVaq42QCvoFpa1bOaim+SMZRGD\r\nZg6km3ooF+dfQVns1HftS9yra04lAdaOZqjknGbWljh849/a9rbTAf+aF/SX\r\nIfEJRsS56Aw1X7bZYikmG192Gaw9sxg1fvhWo1s68dViZvI0rInn0aFUhQTw\r\n/rAFYNLbKfPDgzF3+yETWnuKI+hUs/9rLp4=\r\n=BNJC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./lib/nano.js","types":"./lib/nano.d.ts","engines":{"node":">=14"},"scripts":{"jest":"jest test/* --coverage --env node","test":"standard && tsc lib/nano.d.ts && npm run jest","standard":"standard --fix"},"_npmUser":{"name":"mike_chuckles","email":"me@michaeldrury.co.uk"},"standard":{"env":["jest"]},"noticeText":"Apache CouchDB Nano\nCopyright [2016-2018] The Apache Software Foundation\n\nThis product includes software developed at\nThe Apache Software Foundation (http://www.apache.org/).\n","pre-commit":["test"],"repository":{"url":"http://github.com/apache/couchdb-nano","type":"git"},"description":"The official CouchDB client for Node.js","directories":{},"licenseText":"\n                                Apache License\n                          Version 2.0, January 2004\n                       http://www.apache.org/licenses/\n\n  TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n  1. Definitions.\n\n     \"License\" shall mean the terms and conditions for use, reproduction,\n     and distribution as defined by Sections 1 through 9 of this document.\n\n     \"Licensor\" shall mean the copyright owner or entity authorized by\n     the copyright owner that is granting the License.\n\n     \"Legal Entity\" shall mean the union of the acting entity and all\n     other entities that control, are controlled by, or are under common\n     control with that entity. For the purposes of this definition,\n     \"control\" means (i) the power, direct or indirect, to cause the\n     direction or management of such entity, whether by contract or\n     otherwise, or (ii) ownership of fifty percent (50%) or more of the\n     outstanding shares, or (iii) beneficial ownership of such entity.\n\n     \"You\" (or \"Your\") shall mean an individual or Legal Entity\n     exercising permissions granted by this License.\n\n     \"Source\" form shall mean the preferred form for making modifications,\n     including but not limited to software source code, documentation\n     source, and configuration files.\n\n     \"Object\" form shall mean any form resulting from mechanical\n     transformation or translation of a Source form, including but\n     not limited to compiled object code, generated documentation,\n     and conversions to other media types.\n\n     \"Work\" shall mean the work of authorship, whether in Source or\n     Object form, made available under the License, as indicated by a\n     copyright notice that is included in or attached to the work\n     (an example is provided in the Appendix below).\n\n     \"Derivative Works\" shall mean any work, whether in Source or Object\n     form, that is based on (or derived from) the Work and for which the\n     editorial revisions, annotations, elaborations, or other modifications\n     represent, as a whole, an original work of authorship. For the purposes\n     of this License, Derivative Works shall not include works that remain\n     separable from, or merely link (or bind by name) to the interfaces of,\n     the Work and Derivative Works thereof.\n\n     \"Contribution\" shall mean any work of authorship, including\n     the original version of the Work and any modifications or additions\n     to that Work or Derivative Works thereof, that is intentionally\n     submitted to Licensor for inclusion in the Work by the copyright owner\n     or by an individual or Legal Entity authorized to submit on behalf of\n     the copyright owner. For the purposes of this definition, \"submitted\"\n     means any form of electronic, verbal, or written communication sent\n     to the Licensor or its representatives, including but not limited to\n     communication on electronic mailing lists, source code control systems,\n     and issue tracking systems that are managed by, or on behalf of, the\n     Licensor for the purpose of discussing and improving the Work, but\n     excluding communication that is conspicuously marked or otherwise\n     designated in writing by the copyright owner as \"Not a Contribution.\"\n\n     \"Contributor\" shall mean Licensor and any individual or Legal Entity\n     on behalf of whom a Contribution has been received by Licensor and\n     subsequently incorporated within the Work.\n\n  2. Grant of Copyright License. Subject to the terms and conditions of\n     this License, each Contributor hereby grants to You a perpetual,\n     worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n     copyright license to reproduce, prepare Derivative Works of,\n     publicly display, publicly perform, sublicense, and distribute the\n     Work and such Derivative Works in Source or Object form.\n\n  3. Grant of Patent License. Subject to the terms and conditions of\n     this License, each Contributor hereby grants to You a perpetual,\n     worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n     (except as stated in this section) patent license to make, have made,\n     use, offer to sell, sell, import, and otherwise transfer the Work,\n     where such license applies only to those patent claims licensable\n     by such Contributor that are necessarily infringed by their\n     Contribution(s) alone or by combination of their Contribution(s)\n     with the Work to which such Contribution(s) was submitted. If You\n     institute patent litigation against any entity (including a\n     cross-claim or counterclaim in a lawsuit) alleging that the Work\n     or a Contribution incorporated within the Work constitutes direct\n     or contributory patent infringement, then any patent licenses\n     granted to You under this License for that Work shall terminate\n     as of the date such litigation is filed.\n\n  4. Redistribution. You may reproduce and distribute copies of the\n     Work or Derivative Works thereof in any medium, with or without\n     modifications, and in Source or Object form, provided that You\n     meet the following conditions:\n\n     (a) You must give any other recipients of the Work or\n         Derivative Works a copy of this License; and\n\n     (b) You must cause any modified files to carry prominent notices\n         stating that You changed the files; and\n\n     (c) You must retain, in the Source form of any Derivative Works\n         that You distribute, all copyright, patent, trademark, and\n         attribution notices from the Source form of the Work,\n         excluding those notices that do not pertain to any part of\n         the Derivative Works; and\n\n     (d) If the Work includes a \"NOTICE\" text file as part of its\n         distribution, then any Derivative Works that You distribute must\n         include a readable copy of the attribution notices contained\n         within such NOTICE file, excluding those notices that do not\n         pertain to any part of the Derivative Works, in at least one\n         of the following places: within a NOTICE text file distributed\n         as part of the Derivative Works; within the Source form or\n         documentation, if provided along with the Derivative Works; or,\n         within a display generated by the Derivative Works, if and\n         wherever such third-party notices normally appear. The contents\n         of the NOTICE file are for informational purposes only and\n         do not modify the License. You may add Your own attribution\n         notices within Derivative Works that You distribute, alongside\n         or as an addendum to the NOTICE text from the Work, provided\n         that such additional attribution notices cannot be construed\n         as modifying the License.\n\n     You may add Your own copyright statement to Your modifications and\n     may provide additional or different license terms and conditions\n     for use, reproduction, or distribution of Your modifications, or\n     for any such Derivative Works as a whole, provided Your use,\n     reproduction, and distribution of the Work otherwise complies with\n     the conditions stated in this License.\n\n  5. Submission of Contributions. Unless You explicitly state otherwise,\n     any Contribution intentionally submitted for inclusion in the Work\n     by You to the Licensor shall be under the terms and conditions of\n     this License, without any additional terms or conditions.\n     Notwithstanding the above, nothing herein shall supersede or modify\n     the terms of any separate license agreement you may have executed\n     with Licensor regarding such Contributions.\n\n  6. Trademarks. This License does not grant permission to use the trade\n     names, trademarks, service marks, or product names of the Licensor,\n     except as required for reasonable and customary use in describing the\n     origin of the Work and reproducing the content of the NOTICE file.\n\n  7. Disclaimer of Warranty. Unless required by applicable law or\n     agreed to in writing, Licensor provides the Work (and each\n     Contributor provides its Contributions) on an \"AS IS\" BASIS,\n     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n     implied, including, without limitation, any warranties or conditions\n     of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n     PARTICULAR PURPOSE. You are solely responsible for determining the\n     appropriateness of using or redistributing the Work and assume any\n     risks associated with Your exercise of permissions under this License.\n\n  8. Limitation of Liability. In no event and under no legal theory,\n     whether in tort (including negligence), contract, or otherwise,\n     unless required by applicable law (such as deliberate and grossly\n     negligent acts) or agreed to in writing, shall any Contributor be\n     liable to You for damages, including any direct, indirect, special,\n     incidental, or consequential damages of any character arising as a\n     result of this License or out of the use or inability to use the\n     Work (including but not limited to damages for loss of goodwill,\n     work stoppage, computer failure or malfunction, or any and all\n     other commercial damages or losses), even if such Contributor\n     has been advised of the possibility of such damages.\n\n  9. Accepting Warranty or Additional Liability. While redistributing\n     the Work or Derivative Works thereof, You may choose to offer,\n     and charge a fee for, acceptance of support, warranty, indemnity,\n     or other liability obligations and/or rights consistent with this\n     License. However, in accepting such obligations, You may act only\n     on Your own behalf and on Your sole responsibility, not on behalf\n     of any other Contributor, and only if You agree to indemnify,\n     defend, and hold each Contributor harmless for any liability\n     incurred by, or claims asserted against, such Contributor by reason\n     of your accepting any such warranty or additional liability.\n\n  END OF TERMS AND CONDITIONS\n\n  APPENDIX: How to apply the Apache License to your work.\n\n     To apply the Apache License to your work, attach the following\n     boilerplate notice, with the fields enclosed by brackets \"[]\"\n     replaced with your own identifying information. (Don't include\n     the brackets!)  The text should be enclosed in the appropriate\n     comment syntax for the file format. We also recommend that a\n     file or class name and description of purpose be included on the\n     same \"printed page\" as the copyright notice for easier\n     identification within third-party archives.\n\n  Copyright [yyyy] [name of copyright owner]\n\n  Licensed under the Apache License, Version 2.0 (the \"License\");\n  you may not use this file except in compliance with the License.\n  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n  Unless required by applicable law or agreed to in writing, software\n  distributed under the License is distributed on an \"AS IS\" BASIS,\n  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  See the License for the specific language governing permissions and\n  limitations under the License.\n\n","dependencies":{"qs":"^6.11.0","axios":"^1.1.3","tough-cookie":"^4.1.2","http-cookie-agent":"^4.0.2","@types/tough-cookie":"^4.0.2","node-abort-controller":"^3.0.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.2.2","nock":"^13.2.9","standard":"^17.0.0","typescript":"^4.8.4","@types/node":"^18.11.9"},"_npmOperationalInternal":{"tmp":"tmp/nano_10.1.1_1670975113688_0.9553064410270624","host":"s3://npm-registry-packages"}},"10.1.2":{"name":"@budibase/nano","version":"10.1.2","keywords":["couchdb","data","request","json","nosql","micro","nano","database"],"author":{"url":"http://couchdb.apache.org","name":"Apache CouchDB","email":"dev@couchdb.apache.org"},"license":"Apache-2.0","_id":"@budibase/nano@10.1.2","maintainers":[{"name":"mike_chuckles","email":"me@michaeldrury.co.uk"},{"name":"shogunpurple","email":"martin@budibase.com"}],"homepage":"http://github.com/apache/couchdb-nano","bugs":{"url":"https://github.com/apache/couchdb-nano/issues"},"dist":{"shasum":"10fae5a1ab39be6a81261f40e7b7ec6d21cbdd4a","tarball":"https://registry.npmjs.org/@budibase/nano/-/nano-10.1.2.tgz","fileCount":18,"integrity":"sha512-1w+YN2n/M5aZ9hBKCP4NEjdQbT8BfCLRizkdvm0Je665eEHw3aE1hvo8mon9Ro9QuDdxj1DfDMMFnym6/QUwpQ==","signatures":[{"sig":"MEUCIQD7eHoo/Ro2ouIehm0oKPjOdfN+GFg4ssL2kPCugvQ5CwIgF+dIzoCNR91R4Xi7KZnROP/ZE0FnQFI2bBmBGHk5gqE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":181855,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkAPi2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqsyQ/+IyvpUEcbplJF6CwRBSHkUmnlKGc2L0do11mA+yrfNMAopLoQ\r\nSU3M8tEoVQVVWV4cw+GeqbieMOhdic0K0I/uDYldIREdqpqElq8wmJN4T0TY\r\n8f1bIUWT0iCfPOSUbw9Nq+E5H+KXGmas+ZtGlSZlGlTNrPByqfabYV+kbjtP\r\nFKyLlcBvg9LbpQHt7Lsb88kU3WEh9Em4ZpWfzVQ/uWVH/aHDTfGYP1dnOs9R\r\nxWRUxxGfSR4/0q0F/JdLIq26vXp7V2titts5kX1N8s9ydTR2I3iP5bOutPYH\r\nCN3fTm577L7bhnfXx9YnN75DgZSC0hVFRg35//zu2Fe8RgQgPj9cAcO6lwEe\r\nVUPGqI8bIcDWFriCaShoZ9krZ29EZEC+fxrN//K5qBXKdrIPsOWK/VETVeR6\r\n1CbFxOgsWapTmiKq3z9IuD0sKBYcOnLNaXsrrDNn7SQtzFlfMx0PAPJ4M2zO\r\n0uNlpcQf2nS4fTca1asP3qJD6dhh8RNoxB7aQbgPZJ7FTCaom9vT+rkr4I5F\r\nYKj2mJrni0UGAJwDkySPQE64IOQOwRZf4S3CbnB3haII7POKLN4Y9tfDpk5i\r\nTw81hzn9+lWIChhOb9qAa5rus0j8IQ4Yo3Ql8McRBXgTF7JE5KKSqYvpe37c\r\njlchAFv/pCImSPfkN85BcB0nw2LrYq4QoWQ=\r\n=SwPm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./lib/nano.js","types":"./lib/nano.d.ts","engines":{"node":">=14"},"gitHead":"4f8d39eec3c0b6e6c4f587b199fb05a00dbeacc3","scripts":{"jest":"jest test/* --coverage --env node","test":"standard && tsc lib/nano.d.ts && npm run jest","standard":"standard --fix"},"_npmUser":{"name":"mike_chuckles","email":"me@michaeldrury.co.uk"},"standard":{"env":["jest"]},"pre-commit":["test"],"repository":{"url":"git+ssh://git@github.com/apache/couchdb-nano.git","type":"git"},"_npmVersion":"8.19.3","description":"The official CouchDB client for Node.js","directories":{},"_nodeVersion":"16.19.0","dependencies":{"qs":"^6.11.0","axios":"^1.1.3","tough-cookie":"^4.1.2","http-cookie-agent":"^4.0.2","@types/tough-cookie":"^4.0.2","node-abort-controller":"^3.0.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.2.2","nock":"^13.2.9","standard":"^17.0.0","typescript":"^4.8.4","@types/node":"^18.11.9"},"_npmOperationalInternal":{"tmp":"tmp/nano_10.1.2_1677785270601_0.9845460306280045","host":"s3://npm-registry-packages"}},"10.1.3":{"name":"@budibase/nano","version":"10.1.3","keywords":["couchdb","data","request","json","nosql","micro","nano","database"],"author":{"url":"http://couchdb.apache.org","name":"Apache CouchDB","email":"dev@couchdb.apache.org"},"license":"Apache-2.0","_id":"@budibase/nano@10.1.3","maintainers":[{"name":"mike_chuckles","email":"me@michaeldrury.co.uk"},{"name":"shogunpurple","email":"martin@budibase.com"}],"homepage":"http://github.com/apache/couchdb-nano","dist":{"shasum":"81b99d76b5c256a393e6ee0e284a6aecc517e4b8","tarball":"https://registry.npmjs.org/@budibase/nano/-/nano-10.1.3.tgz","fileCount":14,"integrity":"sha512-UuhwjKCfVO+oVB0dbKpssZfTfb5k3CTrbrjqdx0kd971zzSRMFJ0TwvBB/2Z7kgOOA+Evoq4BSd747meEz21YA==","signatures":[{"sig":"MEYCIQCFn4nQcGZw8vSl8361Eqrj4q2+eQboIUwjmnkAcQCCggIhAOfsyXE/hFnmmJ7uQYP+eAw85QlNp0K4qKqIlRIcsGWc","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":177304},"main":"./lib/nano.js","types":"./lib/nano.d.ts","engines":{"node":">=14"},"scripts":{"jest":"jest test/* --coverage --env node","test":"standard && tsc lib/nano.d.ts && npm run jest","standard":"standard --fix"},"_npmUser":{"name":"mike_chuckles","email":"me@michaeldrury.co.uk"},"standard":{"env":["jest"]},"noticeText":"Apache CouchDB Nano\nCopyright [2016-2018] The Apache Software Foundation\n\nThis product includes software developed at\nThe Apache Software Foundation (http://www.apache.org/).\n","pre-commit":["test"],"repository":{"url":"http://github.com/apache/couchdb-nano","type":"git"},"description":"The official CouchDB client for Node.js","directories":{},"licenseText":"\n                                Apache License\n                          Version 2.0, January 2004\n                       http://www.apache.org/licenses/\n\n  TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n  1. Definitions.\n\n     \"License\" shall mean the terms and conditions for use, reproduction,\n     and distribution as defined by Sections 1 through 9 of this document.\n\n     \"Licensor\" shall mean the copyright owner or entity authorized by\n     the copyright owner that is granting the License.\n\n     \"Legal Entity\" shall mean the union of the acting entity and all\n     other entities that control, are controlled by, or are under common\n     control with that entity. For the purposes of this definition,\n     \"control\" means (i) the power, direct or indirect, to cause the\n     direction or management of such entity, whether by contract or\n     otherwise, or (ii) ownership of fifty percent (50%) or more of the\n     outstanding shares, or (iii) beneficial ownership of such entity.\n\n     \"You\" (or \"Your\") shall mean an individual or Legal Entity\n     exercising permissions granted by this License.\n\n     \"Source\" form shall mean the preferred form for making modifications,\n     including but not limited to software source code, documentation\n     source, and configuration files.\n\n     \"Object\" form shall mean any form resulting from mechanical\n     transformation or translation of a Source form, including but\n     not limited to compiled object code, generated documentation,\n     and conversions to other media types.\n\n     \"Work\" shall mean the work of authorship, whether in Source or\n     Object form, made available under the License, as indicated by a\n     copyright notice that is included in or attached to the work\n     (an example is provided in the Appendix below).\n\n     \"Derivative Works\" shall mean any work, whether in Source or Object\n     form, that is based on (or derived from) the Work and for which the\n     editorial revisions, annotations, elaborations, or other modifications\n     represent, as a whole, an original work of authorship. For the purposes\n     of this License, Derivative Works shall not include works that remain\n     separable from, or merely link (or bind by name) to the interfaces of,\n     the Work and Derivative Works thereof.\n\n     \"Contribution\" shall mean any work of authorship, including\n     the original version of the Work and any modifications or additions\n     to that Work or Derivative Works thereof, that is intentionally\n     submitted to Licensor for inclusion in the Work by the copyright owner\n     or by an individual or Legal Entity authorized to submit on behalf of\n     the copyright owner. For the purposes of this definition, \"submitted\"\n     means any form of electronic, verbal, or written communication sent\n     to the Licensor or its representatives, including but not limited to\n     communication on electronic mailing lists, source code control systems,\n     and issue tracking systems that are managed by, or on behalf of, the\n     Licensor for the purpose of discussing and improving the Work, but\n     excluding communication that is conspicuously marked or otherwise\n     designated in writing by the copyright owner as \"Not a Contribution.\"\n\n     \"Contributor\" shall mean Licensor and any individual or Legal Entity\n     on behalf of whom a Contribution has been received by Licensor and\n     subsequently incorporated within the Work.\n\n  2. Grant of Copyright License. Subject to the terms and conditions of\n     this License, each Contributor hereby grants to You a perpetual,\n     worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n     copyright license to reproduce, prepare Derivative Works of,\n     publicly display, publicly perform, sublicense, and distribute the\n     Work and such Derivative Works in Source or Object form.\n\n  3. Grant of Patent License. Subject to the terms and conditions of\n     this License, each Contributor hereby grants to You a perpetual,\n     worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n     (except as stated in this section) patent license to make, have made,\n     use, offer to sell, sell, import, and otherwise transfer the Work,\n     where such license applies only to those patent claims licensable\n     by such Contributor that are necessarily infringed by their\n     Contribution(s) alone or by combination of their Contribution(s)\n     with the Work to which such Contribution(s) was submitted. If You\n     institute patent litigation against any entity (including a\n     cross-claim or counterclaim in a lawsuit) alleging that the Work\n     or a Contribution incorporated within the Work constitutes direct\n     or contributory patent infringement, then any patent licenses\n     granted to You under this License for that Work shall terminate\n     as of the date such litigation is filed.\n\n  4. Redistribution. You may reproduce and distribute copies of the\n     Work or Derivative Works thereof in any medium, with or without\n     modifications, and in Source or Object form, provided that You\n     meet the following conditions:\n\n     (a) You must give any other recipients of the Work or\n         Derivative Works a copy of this License; and\n\n     (b) You must cause any modified files to carry prominent notices\n         stating that You changed the files; and\n\n     (c) You must retain, in the Source form of any Derivative Works\n         that You distribute, all copyright, patent, trademark, and\n         attribution notices from the Source form of the Work,\n         excluding those notices that do not pertain to any part of\n         the Derivative Works; and\n\n     (d) If the Work includes a \"NOTICE\" text file as part of its\n         distribution, then any Derivative Works that You distribute must\n         include a readable copy of the attribution notices contained\n         within such NOTICE file, excluding those notices that do not\n         pertain to any part of the Derivative Works, in at least one\n         of the following places: within a NOTICE text file distributed\n         as part of the Derivative Works; within the Source form or\n         documentation, if provided along with the Derivative Works; or,\n         within a display generated by the Derivative Works, if and\n         wherever such third-party notices normally appear. The contents\n         of the NOTICE file are for informational purposes only and\n         do not modify the License. You may add Your own attribution\n         notices within Derivative Works that You distribute, alongside\n         or as an addendum to the NOTICE text from the Work, provided\n         that such additional attribution notices cannot be construed\n         as modifying the License.\n\n     You may add Your own copyright statement to Your modifications and\n     may provide additional or different license terms and conditions\n     for use, reproduction, or distribution of Your modifications, or\n     for any such Derivative Works as a whole, provided Your use,\n     reproduction, and distribution of the Work otherwise complies with\n     the conditions stated in this License.\n\n  5. Submission of Contributions. Unless You explicitly state otherwise,\n     any Contribution intentionally submitted for inclusion in the Work\n     by You to the Licensor shall be under the terms and conditions of\n     this License, without any additional terms or conditions.\n     Notwithstanding the above, nothing herein shall supersede or modify\n     the terms of any separate license agreement you may have executed\n     with Licensor regarding such Contributions.\n\n  6. Trademarks. This License does not grant permission to use the trade\n     names, trademarks, service marks, or product names of the Licensor,\n     except as required for reasonable and customary use in describing the\n     origin of the Work and reproducing the content of the NOTICE file.\n\n  7. Disclaimer of Warranty. Unless required by applicable law or\n     agreed to in writing, Licensor provides the Work (and each\n     Contributor provides its Contributions) on an \"AS IS\" BASIS,\n     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n     implied, including, without limitation, any warranties or conditions\n     of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n     PARTICULAR PURPOSE. You are solely responsible for determining the\n     appropriateness of using or redistributing the Work and assume any\n     risks associated with Your exercise of permissions under this License.\n\n  8. Limitation of Liability. In no event and under no legal theory,\n     whether in tort (including negligence), contract, or otherwise,\n     unless required by applicable law (such as deliberate and grossly\n     negligent acts) or agreed to in writing, shall any Contributor be\n     liable to You for damages, including any direct, indirect, special,\n     incidental, or consequential damages of any character arising as a\n     result of this License or out of the use or inability to use the\n     Work (including but not limited to damages for loss of goodwill,\n     work stoppage, computer failure or malfunction, or any and all\n     other commercial damages or losses), even if such Contributor\n     has been advised of the possibility of such damages.\n\n  9. Accepting Warranty or Additional Liability. While redistributing\n     the Work or Derivative Works thereof, You may choose to offer,\n     and charge a fee for, acceptance of support, warranty, indemnity,\n     or other liability obligations and/or rights consistent with this\n     License. However, in accepting such obligations, You may act only\n     on Your own behalf and on Your sole responsibility, not on behalf\n     of any other Contributor, and only if You agree to indemnify,\n     defend, and hold each Contributor harmless for any liability\n     incurred by, or claims asserted against, such Contributor by reason\n     of your accepting any such warranty or additional liability.\n\n  END OF TERMS AND CONDITIONS\n\n  APPENDIX: How to apply the Apache License to your work.\n\n     To apply the Apache License to your work, attach the following\n     boilerplate notice, with the fields enclosed by brackets \"[]\"\n     replaced with your own identifying information. (Don't include\n     the brackets!)  The text should be enclosed in the appropriate\n     comment syntax for the file format. We also recommend that a\n     file or class name and description of purpose be included on the\n     same \"printed page\" as the copyright notice for easier\n     identification within third-party archives.\n\n  Copyright [yyyy] [name of copyright owner]\n\n  Licensed under the Apache License, Version 2.0 (the \"License\");\n  you may not use this file except in compliance with the License.\n  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n  Unless required by applicable law or agreed to in writing, software\n  distributed under the License is distributed on an \"AS IS\" BASIS,\n  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  See the License for the specific language governing permissions and\n  limitations under the License.\n\n","dependencies":{"qs":"^6.11.0","axios":"^1.1.3","tough-cookie":"^4.1.2","http-cookie-agent":"^4.0.2","@types/tough-cookie":"^4.0.2","node-abort-controller":"^3.0.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.2.2","nock":"^13.2.9","standard":"^17.0.0","typescript":"^4.8.4","@types/node":"^18.11.9"},"_npmOperationalInternal":{"tmp":"tmp/nano_10.1.3_1698331348106_0.7579633023678287","host":"s3://npm-registry-packages"}},"10.1.4":{"name":"@budibase/nano","version":"10.1.4","keywords":["couchdb","data","request","json","nosql","micro","nano","database"],"author":{"url":"http://couchdb.apache.org","name":"Apache CouchDB","email":"dev@couchdb.apache.org"},"license":"Apache-2.0","_id":"@budibase/nano@10.1.4","maintainers":[{"name":"mike_chuckles","email":"me@michaeldrury.co.uk"},{"name":"shogunpurple","email":"martin@budibase.com"}],"homepage":"http://github.com/apache/couchdb-nano","dist":{"shasum":"5c2670d0b4c12d736ddd6581c57d47c0aa45efad","tarball":"https://registry.npmjs.org/@budibase/nano/-/nano-10.1.4.tgz","fileCount":14,"integrity":"sha512-J+IVaAljGideDvJss/AUxXA1599HEIUJo5c0LLlmc1KMA3GZWZjyX+w2fxAw3qF7hqFvX+qAStQgdcD3+/GPMA==","signatures":[{"sig":"MEUCIQClv/ASa++FxbNbj5aFzqVcs0VcGrE7kmH104QMZpNHsQIgV8HO/tp2bxrlHpSrEcOJIfhoFe48P88jNlLEIsZcGqk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":177268},"main":"./lib/nano.js","types":"./lib/nano.d.ts","engines":{"node":">=14"},"scripts":{"jest":"jest test/* --coverage --env node","test":"standard && tsc lib/nano.d.ts && npm run jest","standard":"standard --fix"},"_npmUser":{"name":"mike_chuckles","email":"me@michaeldrury.co.uk"},"standard":{"env":["jest"]},"noticeText":"Apache CouchDB Nano\nCopyright [2016-2018] The Apache Software Foundation\n\nThis product includes software developed at\nThe Apache Software Foundation (http://www.apache.org/).\n","pre-commit":["test"],"repository":{"url":"http://github.com/apache/couchdb-nano","type":"git"},"description":"The official CouchDB client for Node.js","directories":{},"licenseText":"\n                                Apache License\n                          Version 2.0, January 2004\n                       http://www.apache.org/licenses/\n\n  TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n  1. Definitions.\n\n     \"License\" shall mean the terms and conditions for use, reproduction,\n     and distribution as defined by Sections 1 through 9 of this document.\n\n     \"Licensor\" shall mean the copyright owner or entity authorized by\n     the copyright owner that is granting the License.\n\n     \"Legal Entity\" shall mean the union of the acting entity and all\n     other entities that control, are controlled by, or are under common\n     control with that entity. For the purposes of this definition,\n     \"control\" means (i) the power, direct or indirect, to cause the\n     direction or management of such entity, whether by contract or\n     otherwise, or (ii) ownership of fifty percent (50%) or more of the\n     outstanding shares, or (iii) beneficial ownership of such entity.\n\n     \"You\" (or \"Your\") shall mean an individual or Legal Entity\n     exercising permissions granted by this License.\n\n     \"Source\" form shall mean the preferred form for making modifications,\n     including but not limited to software source code, documentation\n     source, and configuration files.\n\n     \"Object\" form shall mean any form resulting from mechanical\n     transformation or translation of a Source form, including but\n     not limited to compiled object code, generated documentation,\n     and conversions to other media types.\n\n     \"Work\" shall mean the work of authorship, whether in Source or\n     Object form, made available under the License, as indicated by a\n     copyright notice that is included in or attached to the work\n     (an example is provided in the Appendix below).\n\n     \"Derivative Works\" shall mean any work, whether in Source or Object\n     form, that is based on (or derived from) the Work and for which the\n     editorial revisions, annotations, elaborations, or other modifications\n     represent, as a whole, an original work of authorship. For the purposes\n     of this License, Derivative Works shall not include works that remain\n     separable from, or merely link (or bind by name) to the interfaces of,\n     the Work and Derivative Works thereof.\n\n     \"Contribution\" shall mean any work of authorship, including\n     the original version of the Work and any modifications or additions\n     to that Work or Derivative Works thereof, that is intentionally\n     submitted to Licensor for inclusion in the Work by the copyright owner\n     or by an individual or Legal Entity authorized to submit on behalf of\n     the copyright owner. For the purposes of this definition, \"submitted\"\n     means any form of electronic, verbal, or written communication sent\n     to the Licensor or its representatives, including but not limited to\n     communication on electronic mailing lists, source code control systems,\n     and issue tracking systems that are managed by, or on behalf of, the\n     Licensor for the purpose of discussing and improving the Work, but\n     excluding communication that is conspicuously marked or otherwise\n     designated in writing by the copyright owner as \"Not a Contribution.\"\n\n     \"Contributor\" shall mean Licensor and any individual or Legal Entity\n     on behalf of whom a Contribution has been received by Licensor and\n     subsequently incorporated within the Work.\n\n  2. Grant of Copyright License. Subject to the terms and conditions of\n     this License, each Contributor hereby grants to You a perpetual,\n     worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n     copyright license to reproduce, prepare Derivative Works of,\n     publicly display, publicly perform, sublicense, and distribute the\n     Work and such Derivative Works in Source or Object form.\n\n  3. Grant of Patent License. Subject to the terms and conditions of\n     this License, each Contributor hereby grants to You a perpetual,\n     worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n     (except as stated in this section) patent license to make, have made,\n     use, offer to sell, sell, import, and otherwise transfer the Work,\n     where such license applies only to those patent claims licensable\n     by such Contributor that are necessarily infringed by their\n     Contribution(s) alone or by combination of their Contribution(s)\n     with the Work to which such Contribution(s) was submitted. If You\n     institute patent litigation against any entity (including a\n     cross-claim or counterclaim in a lawsuit) alleging that the Work\n     or a Contribution incorporated within the Work constitutes direct\n     or contributory patent infringement, then any patent licenses\n     granted to You under this License for that Work shall terminate\n     as of the date such litigation is filed.\n\n  4. Redistribution. You may reproduce and distribute copies of the\n     Work or Derivative Works thereof in any medium, with or without\n     modifications, and in Source or Object form, provided that You\n     meet the following conditions:\n\n     (a) You must give any other recipients of the Work or\n         Derivative Works a copy of this License; and\n\n     (b) You must cause any modified files to carry prominent notices\n         stating that You changed the files; and\n\n     (c) You must retain, in the Source form of any Derivative Works\n         that You distribute, all copyright, patent, trademark, and\n         attribution notices from the Source form of the Work,\n         excluding those notices that do not pertain to any part of\n         the Derivative Works; and\n\n     (d) If the Work includes a \"NOTICE\" text file as part of its\n         distribution, then any Derivative Works that You distribute must\n         include a readable copy of the attribution notices contained\n         within such NOTICE file, excluding those notices that do not\n         pertain to any part of the Derivative Works, in at least one\n         of the following places: within a NOTICE text file distributed\n         as part of the Derivative Works; within the Source form or\n         documentation, if provided along with the Derivative Works; or,\n         within a display generated by the Derivative Works, if and\n         wherever such third-party notices normally appear. The contents\n         of the NOTICE file are for informational purposes only and\n         do not modify the License. You may add Your own attribution\n         notices within Derivative Works that You distribute, alongside\n         or as an addendum to the NOTICE text from the Work, provided\n         that such additional attribution notices cannot be construed\n         as modifying the License.\n\n     You may add Your own copyright statement to Your modifications and\n     may provide additional or different license terms and conditions\n     for use, reproduction, or distribution of Your modifications, or\n     for any such Derivative Works as a whole, provided Your use,\n     reproduction, and distribution of the Work otherwise complies with\n     the conditions stated in this License.\n\n  5. Submission of Contributions. Unless You explicitly state otherwise,\n     any Contribution intentionally submitted for inclusion in the Work\n     by You to the Licensor shall be under the terms and conditions of\n     this License, without any additional terms or conditions.\n     Notwithstanding the above, nothing herein shall supersede or modify\n     the terms of any separate license agreement you may have executed\n     with Licensor regarding such Contributions.\n\n  6. Trademarks. This License does not grant permission to use the trade\n     names, trademarks, service marks, or product names of the Licensor,\n     except as required for reasonable and customary use in describing the\n     origin of the Work and reproducing the content of the NOTICE file.\n\n  7. Disclaimer of Warranty. Unless required by applicable law or\n     agreed to in writing, Licensor provides the Work (and each\n     Contributor provides its Contributions) on an \"AS IS\" BASIS,\n     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n     implied, including, without limitation, any warranties or conditions\n     of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n     PARTICULAR PURPOSE. You are solely responsible for determining the\n     appropriateness of using or redistributing the Work and assume any\n     risks associated with Your exercise of permissions under this License.\n\n  8. Limitation of Liability. In no event and under no legal theory,\n     whether in tort (including negligence), contract, or otherwise,\n     unless required by applicable law (such as deliberate and grossly\n     negligent acts) or agreed to in writing, shall any Contributor be\n     liable to You for damages, including any direct, indirect, special,\n     incidental, or consequential damages of any character arising as a\n     result of this License or out of the use or inability to use the\n     Work (including but not limited to damages for loss of goodwill,\n     work stoppage, computer failure or malfunction, or any and all\n     other commercial damages or losses), even if such Contributor\n     has been advised of the possibility of such damages.\n\n  9. Accepting Warranty or Additional Liability. While redistributing\n     the Work or Derivative Works thereof, You may choose to offer,\n     and charge a fee for, acceptance of support, warranty, indemnity,\n     or other liability obligations and/or rights consistent with this\n     License. However, in accepting such obligations, You may act only\n     on Your own behalf and on Your sole responsibility, not on behalf\n     of any other Contributor, and only if You agree to indemnify,\n     defend, and hold each Contributor harmless for any liability\n     incurred by, or claims asserted against, such Contributor by reason\n     of your accepting any such warranty or additional liability.\n\n  END OF TERMS AND CONDITIONS\n\n  APPENDIX: How to apply the Apache License to your work.\n\n     To apply the Apache License to your work, attach the following\n     boilerplate notice, with the fields enclosed by brackets \"[]\"\n     replaced with your own identifying information. (Don't include\n     the brackets!)  The text should be enclosed in the appropriate\n     comment syntax for the file format. We also recommend that a\n     file or class name and description of purpose be included on the\n     same \"printed page\" as the copyright notice for easier\n     identification within third-party archives.\n\n  Copyright [yyyy] [name of copyright owner]\n\n  Licensed under the Apache License, Version 2.0 (the \"License\");\n  you may not use this file except in compliance with the License.\n  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n  Unless required by applicable law or agreed to in writing, software\n  distributed under the License is distributed on an \"AS IS\" BASIS,\n  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  See the License for the specific language governing permissions and\n  limitations under the License.\n\n","dependencies":{"qs":"^6.11.0","axios":"^1.1.3","tough-cookie":"^4.1.2","http-cookie-agent":"^4.0.2","@types/tough-cookie":"^4.0.2","node-abort-controller":"^3.0.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.2.2","nock":"^13.2.9","standard":"^17.0.0","typescript":"^4.8.4","@types/node":"^18.11.9"},"_npmOperationalInternal":{"tmp":"tmp/nano_10.1.4_1698417381036_0.7294027967682699","host":"s3://npm-registry-packages"}},"10.1.5":{"name":"@budibase/nano","version":"10.1.5","keywords":["couchdb","data","request","json","nosql","micro","nano","database"],"author":{"url":"http://couchdb.apache.org","name":"Apache CouchDB","email":"dev@couchdb.apache.org"},"license":"Apache-2.0","_id":"@budibase/nano@10.1.5","maintainers":[{"name":"mike_chuckles","email":"me@michaeldrury.co.uk"},{"name":"shogunpurple","email":"martin@budibase.com"}],"homepage":"http://github.com/apache/couchdb-nano","dist":{"shasum":"eeaded7bfc707ecabf8fde604425b865a90c06ec","tarball":"https://registry.npmjs.org/@budibase/nano/-/nano-10.1.5.tgz","fileCount":14,"integrity":"sha512-q1eKIsYKo+iK17zsJYd3VBl+5ufQMPpHYLec0wVsid8wnJVrTQk7RNpBlBUn/EDgXM7t8XNNHlERqHu+CxJu8Q==","signatures":[{"sig":"MEUCIQDtQCKRSi5aP3wZWzTnlh3TR18MPHuyts2snJNerbBqoAIgdW80V7DpB8+w0y4fH5C6cG/a4Xiw+bhX4vWUQs8QgPM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":177215},"main":"./lib/nano.js","types":"./lib/nano.d.ts","engines":{"node":">=14"},"scripts":{"jest":"jest test/* --coverage --env node","test":"standard && tsc lib/nano.d.ts && npm run jest","standard":"standard --fix"},"_npmUser":{"name":"mike_chuckles","email":"me@michaeldrury.co.uk"},"standard":{"env":["jest"]},"noticeText":"Apache CouchDB Nano\nCopyright [2016-2018] The Apache Software Foundation\n\nThis product includes software developed at\nThe Apache Software Foundation (http://www.apache.org/).\n","pre-commit":["test"],"repository":{"url":"http://github.com/apache/couchdb-nano","type":"git"},"description":"The official CouchDB client for Node.js","directories":{},"licenseText":"\n                                Apache License\n                          Version 2.0, January 2004\n                       http://www.apache.org/licenses/\n\n  TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n  1. Definitions.\n\n     \"License\" shall mean the terms and conditions for use, reproduction,\n     and distribution as defined by Sections 1 through 9 of this document.\n\n     \"Licensor\" shall mean the copyright owner or entity authorized by\n     the copyright owner that is granting the License.\n\n     \"Legal Entity\" shall mean the union of the acting entity and all\n     other entities that control, are controlled by, or are under common\n     control with that entity. For the purposes of this definition,\n     \"control\" means (i) the power, direct or indirect, to cause the\n     direction or management of such entity, whether by contract or\n     otherwise, or (ii) ownership of fifty percent (50%) or more of the\n     outstanding shares, or (iii) beneficial ownership of such entity.\n\n     \"You\" (or \"Your\") shall mean an individual or Legal Entity\n     exercising permissions granted by this License.\n\n     \"Source\" form shall mean the preferred form for making modifications,\n     including but not limited to software source code, documentation\n     source, and configuration files.\n\n     \"Object\" form shall mean any form resulting from mechanical\n     transformation or translation of a Source form, including but\n     not limited to compiled object code, generated documentation,\n     and conversions to other media types.\n\n     \"Work\" shall mean the work of authorship, whether in Source or\n     Object form, made available under the License, as indicated by a\n     copyright notice that is included in or attached to the work\n     (an example is provided in the Appendix below).\n\n     \"Derivative Works\" shall mean any work, whether in Source or Object\n     form, that is based on (or derived from) the Work and for which the\n     editorial revisions, annotations, elaborations, or other modifications\n     represent, as a whole, an original work of authorship. For the purposes\n     of this License, Derivative Works shall not include works that remain\n     separable from, or merely link (or bind by name) to the interfaces of,\n     the Work and Derivative Works thereof.\n\n     \"Contribution\" shall mean any work of authorship, including\n     the original version of the Work and any modifications or additions\n     to that Work or Derivative Works thereof, that is intentionally\n     submitted to Licensor for inclusion in the Work by the copyright owner\n     or by an individual or Legal Entity authorized to submit on behalf of\n     the copyright owner. For the purposes of this definition, \"submitted\"\n     means any form of electronic, verbal, or written communication sent\n     to the Licensor or its representatives, including but not limited to\n     communication on electronic mailing lists, source code control systems,\n     and issue tracking systems that are managed by, or on behalf of, the\n     Licensor for the purpose of discussing and improving the Work, but\n     excluding communication that is conspicuously marked or otherwise\n     designated in writing by the copyright owner as \"Not a Contribution.\"\n\n     \"Contributor\" shall mean Licensor and any individual or Legal Entity\n     on behalf of whom a Contribution has been received by Licensor and\n     subsequently incorporated within the Work.\n\n  2. Grant of Copyright License. Subject to the terms and conditions of\n     this License, each Contributor hereby grants to You a perpetual,\n     worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n     copyright license to reproduce, prepare Derivative Works of,\n     publicly display, publicly perform, sublicense, and distribute the\n     Work and such Derivative Works in Source or Object form.\n\n  3. Grant of Patent License. Subject to the terms and conditions of\n     this License, each Contributor hereby grants to You a perpetual,\n     worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n     (except as stated in this section) patent license to make, have made,\n     use, offer to sell, sell, import, and otherwise transfer the Work,\n     where such license applies only to those patent claims licensable\n     by such Contributor that are necessarily infringed by their\n     Contribution(s) alone or by combination of their Contribution(s)\n     with the Work to which such Contribution(s) was submitted. If You\n     institute patent litigation against any entity (including a\n     cross-claim or counterclaim in a lawsuit) alleging that the Work\n     or a Contribution incorporated within the Work constitutes direct\n     or contributory patent infringement, then any patent licenses\n     granted to You under this License for that Work shall terminate\n     as of the date such litigation is filed.\n\n  4. Redistribution. You may reproduce and distribute copies of the\n     Work or Derivative Works thereof in any medium, with or without\n     modifications, and in Source or Object form, provided that You\n     meet the following conditions:\n\n     (a) You must give any other recipients of the Work or\n         Derivative Works a copy of this License; and\n\n     (b) You must cause any modified files to carry prominent notices\n         stating that You changed the files; and\n\n     (c) You must retain, in the Source form of any Derivative Works\n         that You distribute, all copyright, patent, trademark, and\n         attribution notices from the Source form of the Work,\n         excluding those notices that do not pertain to any part of\n         the Derivative Works; and\n\n     (d) If the Work includes a \"NOTICE\" text file as part of its\n         distribution, then any Derivative Works that You distribute must\n         include a readable copy of the attribution notices contained\n         within such NOTICE file, excluding those notices that do not\n         pertain to any part of the Derivative Works, in at least one\n         of the following places: within a NOTICE text file distributed\n         as part of the Derivative Works; within the Source form or\n         documentation, if provided along with the Derivative Works; or,\n         within a display generated by the Derivative Works, if and\n         wherever such third-party notices normally appear. The contents\n         of the NOTICE file are for informational purposes only and\n         do not modify the License. You may add Your own attribution\n         notices within Derivative Works that You distribute, alongside\n         or as an addendum to the NOTICE text from the Work, provided\n         that such additional attribution notices cannot be construed\n         as modifying the License.\n\n     You may add Your own copyright statement to Your modifications and\n     may provide additional or different license terms and conditions\n     for use, reproduction, or distribution of Your modifications, or\n     for any such Derivative Works as a whole, provided Your use,\n     reproduction, and distribution of the Work otherwise complies with\n     the conditions stated in this License.\n\n  5. Submission of Contributions. Unless You explicitly state otherwise,\n     any Contribution intentionally submitted for inclusion in the Work\n     by You to the Licensor shall be under the terms and conditions of\n     this License, without any additional terms or conditions.\n     Notwithstanding the above, nothing herein shall supersede or modify\n     the terms of any separate license agreement you may have executed\n     with Licensor regarding such Contributions.\n\n  6. Trademarks. This License does not grant permission to use the trade\n     names, trademarks, service marks, or product names of the Licensor,\n     except as required for reasonable and customary use in describing the\n     origin of the Work and reproducing the content of the NOTICE file.\n\n  7. Disclaimer of Warranty. Unless required by applicable law or\n     agreed to in writing, Licensor provides the Work (and each\n     Contributor provides its Contributions) on an \"AS IS\" BASIS,\n     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n     implied, including, without limitation, any warranties or conditions\n     of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n     PARTICULAR PURPOSE. You are solely responsible for determining the\n     appropriateness of using or redistributing the Work and assume any\n     risks associated with Your exercise of permissions under this License.\n\n  8. Limitation of Liability. In no event and under no legal theory,\n     whether in tort (including negligence), contract, or otherwise,\n     unless required by applicable law (such as deliberate and grossly\n     negligent acts) or agreed to in writing, shall any Contributor be\n     liable to You for damages, including any direct, indirect, special,\n     incidental, or consequential damages of any character arising as a\n     result of this License or out of the use or inability to use the\n     Work (including but not limited to damages for loss of goodwill,\n     work stoppage, computer failure or malfunction, or any and all\n     other commercial damages or losses), even if such Contributor\n     has been advised of the possibility of such damages.\n\n  9. Accepting Warranty or Additional Liability. While redistributing\n     the Work or Derivative Works thereof, You may choose to offer,\n     and charge a fee for, acceptance of support, warranty, indemnity,\n     or other liability obligations and/or rights consistent with this\n     License. However, in accepting such obligations, You may act only\n     on Your own behalf and on Your sole responsibility, not on behalf\n     of any other Contributor, and only if You agree to indemnify,\n     defend, and hold each Contributor harmless for any liability\n     incurred by, or claims asserted against, such Contributor by reason\n     of your accepting any such warranty or additional liability.\n\n  END OF TERMS AND CONDITIONS\n\n  APPENDIX: How to apply the Apache License to your work.\n\n     To apply the Apache License to your work, attach the following\n     boilerplate notice, with the fields enclosed by brackets \"[]\"\n     replaced with your own identifying information. (Don't include\n     the brackets!)  The text should be enclosed in the appropriate\n     comment syntax for the file format. We also recommend that a\n     file or class name and description of purpose be included on the\n     same \"printed page\" as the copyright notice for easier\n     identification within third-party archives.\n\n  Copyright [yyyy] [name of copyright owner]\n\n  Licensed under the Apache License, Version 2.0 (the \"License\");\n  you may not use this file except in compliance with the License.\n  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n  Unless required by applicable law or agreed to in writing, software\n  distributed under the License is distributed on an \"AS IS\" BASIS,\n  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  See the License for the specific language governing permissions and\n  limitations under the License.\n\n","dependencies":{"qs":"^6.11.0","axios":"^1.1.3","tough-cookie":"^4.1.2","http-cookie-agent":"^4.0.2","@types/tough-cookie":"^4.0.2","node-abort-controller":"^3.0.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.2.2","nock":"^13.2.9","standard":"^17.0.0","typescript":"^4.8.4","@types/node":"^18.11.9"},"_npmOperationalInternal":{"tmp":"tmp/nano_10.1.5_1706701896694_0.5729495103193196","host":"s3://npm-registry-packages"}},"10.1.6":{"name":"@budibase/nano","version":"10.1.6","keywords":["couchdb","data","request","json","nosql","micro","nano","database"],"author":{"url":"http://couchdb.apache.org","name":"Apache CouchDB","email":"dev@couchdb.apache.org"},"license":"Apache-2.0","_id":"@budibase/nano@10.1.6","maintainers":[{"name":"melbudibase","email":"mel@budibase.com"},{"name":"pclmnt","email":"peter@budibase.com"},{"name":"joranamo","email":"joe@budibase.com"},{"name":"christos-budibase","email":"christos@budibase.com"}],"homepage":"http://github.com/apache/couchdb-nano","bugs":{"url":"https://github.com/apache/couchdb-nano/issues"},"dist":{"shasum":"c847e5a363f0080790e4bd59d815d724bb2d1d2e","tarball":"https://registry.npmjs.org/@budibase/nano/-/nano-10.1.6.tgz","fileCount":12,"integrity":"sha512-xT9SFsThxbDg+hy8iHzXXfpTXiAZd2VIcYp8BjcEEl+SY9c3xZjaJbyWungiM0hXWJX71Ec3f7aPMx75q+axOg==","signatures":[{"sig":"MEQCIALSsA6qIKQVWjFdEVWkT70DkoJzQjKLSKFdbxnmt3MwAiAkyq+2XyV5+ER9+X2aTv0+oYNzpdPT72rAircLFt37+A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":177339},"main":"./lib/nano.js","types":"./lib/nano.d.ts","engines":{"node":">=14"},"gitHead":"04de5500e4bf9bc249d4f22cc76821446c5798cb","scripts":{"jest":"jest test/* --coverage --env node","test":"standard && tsc lib/nano.d.ts && npm run jest","standard":"standard --fix"},"_npmUser":{"name":"melbudibase","email":"mel@budibase.com"},"standard":{"env":["jest"]},"pre-commit":["test"],"repository":{"url":"git+ssh://git@github.com/apache/couchdb-nano.git","type":"git"},"_npmVersion":"10.9.4","description":"The official CouchDB client for Node.js","directories":{},"_nodeVersion":"22.21.1","dependencies":{"qs":"^6.11.0","axios":"1.15.2","tough-cookie":"^4.1.2","http-cookie-agent":"^4.0.2","@types/tough-cookie":"^4.0.2","node-abort-controller":"^3.0.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.2.2","nock":"^13.2.9","standard":"^17.0.0","typescript":"^4.8.4","@types/node":"^18.11.9"},"_npmOperationalInternal":{"tmp":"tmp/nano_10.1.6_1776868170361_0.8976758294456926","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2022-12-13T23:12:10.729Z","modified":"2026-08-17T10:37:33.606Z","10.1.0":"2022-12-13T23:12:10.913Z","10.1.1":"2022-12-13T23:45:13.867Z","10.1.2":"2023-03-02T19:27:50.755Z","10.1.3":"2023-10-26T14:42:28.444Z","10.1.4":"2023-10-27T14:36:21.260Z","10.1.5":"2024-01-31T11:51:36.849Z","10.1.6":"2026-04-22T14:29:30.498Z"},"bugs":{"url":"https://github.com/apache/couchdb-nano/issues"},"author":{"url":"http://couchdb.apache.org","name":"Apache CouchDB","email":"dev@couchdb.apache.org"},"license":"Apache-2.0","homepage":"http://github.com/apache/couchdb-nano","keywords":["couchdb","data","request","json","nosql","micro","nano","database"],"repository":{"url":"git+ssh://git@github.com/apache/couchdb-nano.git","type":"git"},"description":"The official CouchDB client for Node.js","maintainers":[{"email":"mel@budibase.com","name":"melbudibase"},{"email":"joe@budibase.com","name":"joranamo"},{"email":"christos@budibase.com","name":"christos-budibase"},{"email":"adria@budibase.com","name":"adri.bb"}],"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 & 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> Note: The URL you supply may also contain authentication credentials e.g. `http://admin:mypassword@localhost:5984`.\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) => {\n  // success - response is in 'data'\n}).catch((err) => {\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) => {\n  // errors are in 'err' & 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) => {\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) => 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## 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 who's revision 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/2.1.1/api/database/bulk-api.html#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)\ndoclist.rows.forEach((doc) => {\n  console.log(doc);\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) => 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> Note: for `.get()` & `.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) => { console.log(change) })\n  .on('batch', (b) => {\n    console.log('a batch of', b.length, 'changes has arrived');\n  }).on('seq', (s) => {\n    console.log('sequence token', s);\n  }).on('error', (e) => {\n    console.error('error', e);\n  })\n```\n\n> 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) => {\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( () => {\n      db.changesReader.resume()\n    }, 5000)\n  }).on('end', () => {\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 | {\"name\":\"fred}           | null                             |   |\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 `<partition key>:<document id>`. 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) => 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) => 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) => 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) => 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) => 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) => {\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) => {\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 => 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) => {\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) => 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) => 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 > 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 > 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) => 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) => {\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) => 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) => {\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 & 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: <https://github.com/apache/couchdb-nano>\n* bugs: <https://github.com/apache/couchdb-nano/issues>\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","readmeFilename":"README.md"}