{"_id":"@crabas0npm/sint-minima-sint","name":"@crabas0npm/sint-minima-sint","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@crabas0npm/sint-minima-sint","version":"1.0.0","description":"[![NPM](http://img.shields.io/npm/v/@crabas0npm/sint-minima-sint.svg?style=flat-square)](https://www.npmjs.com/package/@crabas0npm/sint-minima-sint)","main":"index.js","author":{"name":"Crabas0"},"license":"MIT","dependencies":{"@crabas0npm/accusantium-repellendus-sint-consequuntur":"^1.0.0","@crabas0npm/alias-consequuntur-hic-enim":"^1.0.0","@crabas0npm/aliquid-vitae-magnam-perspiciatis":"^1.0.0","@crabas0npm/aut-cupiditate-quam-dicta":"^1.0.0","@crabas0npm/blanditiis-est-molestias-a":"^1.0.0","@crabas0npm/consectetur-impedit-exercitationem-error":"^1.0.0","@crabas0npm/corporis-rerum-reprehenderit-voluptates":"^1.0.0","@crabas0npm/delectus-dolorem-consectetur-corrupti":"^1.0.0","@crabas0npm/ea-nisi-earum-mollitia":"^1.0.0","@crabas0npm/et-perspiciatis-eius-modi":"^1.0.0","@crabas0npm/expedita-magnam-quia-perferendis":"^1.0.0","@crabas0npm/expedita-optio-recusandae-nesciunt":"^1.0.0","@crabas0npm/expedita-voluptas-corrupti-ullam":"^1.0.0","@crabas0npm/facilis-doloribus-provident-optio":"^1.0.0","@crabas0npm/fugiat-necessitatibus-recusandae-quo":"^1.0.0","@crabas0npm/maxime-sequi-nam-facere":"^1.0.0","@crabas0npm/minus-iure-ipsum-temporibus":"^1.0.0","@crabas0npm/nulla-minima-vero-facere":"^1.0.0","@crabas0npm/odio-exercitationem-ducimus-provident":"^1.0.0","@crabas0npm/officia-nostrum-at-hic":"^1.0.0","@crabas0npm/officiis-labore-tempora-sint":"^1.0.0","@crabas0npm/omnis-neque-asperiores-rerum":"^1.0.0","@crabas0npm/optio-sequi-optio-quidem":"^1.0.0","@crabas0npm/porro-voluptatem-consectetur-beatae":"^1.0.0","@crabas0npm/possimus-sit-repellat-perspiciatis":"^1.0.0","@crabas0npm/quo-dolorem-molestiae-porro":"^1.0.0","@crabas0npm/ratione-nisi-deleniti-provident":"^1.0.0","@crabas0npm/ratione-voluptatibus-quo-sed":"^1.0.0","@crabas0npm/repellendus-illum-cum-fugit":"^1.0.0","@crabas0npm/unde-quos-asperiores-modi":"^1.0.0","@diahkomalasarinpm/praesentium-sint-dolorem":"^1.0.0","@f1stnpm2/adipisci-adipisci-praesentium":"^1.0.0","@wemnyelezxnpm/delectus-repellendus-neque":"^1.0.0"},"keywords":["graphql","package.json","arraybuffer","jsx","make","shebang","obj","framer","sham","macos","classnames","deep-copy","syntaxerror","client","idle","signal","interrupts","proto","findup","fast-deep-clone","ES3","debugger","TypeBox","https","ES","dir","Array","performant","WebSocket","up","side","rangeerror","performance","ES2020","HyBi","ascii","pose","streams2","picomatch","look","prune","web","from","touch","animation","columns","handlers","art","command-line","chai","import","deterministic","CSS","env","Array.prototype.contains","settings","tslib","trimStart","promises","defineProperty","preprocessor","Microsoft","lru","ReactiveExtensions","bcrypt","column","ECMAScript 2015","consume","color","callbind","ECMAScript 2017","typescript","form","random","ramda","find-up","find","redux-toolkit","link","descriptor","linewrap","[[Prototype]]","task","awesomesauce","argv","getter","formatting","curried","getopt","full-width","immutable","buffer","typed","Set","linux","jsonschema","findLastIndex","streams","valid","Object.getPrototypeOf","dotenv","readable","Array.prototype.findLast","real-time","tdd","batch","sanitize","is","deepclone","ECMAScript 2021","cjk","fsevents","bdd","compile less","logging","sort","limited","configurable","TypeScript","electron","postcss-plugin","authentication","slice","es8","fast","await","move","rm -fr","tape","cli","arrays","contains","matches","setPrototypeOf","time","directory","JSON","call","exec","popmotion","utils","sequence","jasmine","pipe","starter","serialize","fetch","ArrayBuffer.prototype.slice","reducer","es2017","iterate","install","visual","nodejs","ts","RFC-6455","korean","setter","accessibility","ES2018","package","CSSStyleDeclaration","toolkit","css nesting","ie","view","speed","bundling","log","prefix","byteOffset","zero","forms","typeerror","regexp","bootstrap css","coercible","every","loading","expression","sigterm","keys","ES7","installer","yaml","Uint8Array","check","take","functions","shrinkwrap","ECMAScript 7","packages","tap","jsdom","equal","terminal","three","js","clone","core-js","error","Object","pretty","busy","robust","symbols","Underscore","mkdirs","Array.prototype.flatMap","figlet","ender","class-validator","YAML","xhr","spring","test","call-bound","mime","flag","prototype",".env","ES2021","array","colors","escape","phone","forEach","uninstall","indicator","browserslist","Float32Array","es2018","joi","drag","get","typedarrays","stringifier","_.extend","bound","symlink","trimRight","option","write","syntax","safe","push","tester","error-handling","stdlib","fs","symbol","function","buffers","TypedArray","json-schema-validator","wrap","redux","ES2022","stylesheet","queueMicrotask","assertion","node","Rx","lazy","RegExp.prototype.flags","fastcopy","monorepo","bundler","harmony","callback","gradients css","typedarray","Streams","toobject","iterator","rmdir","ECMAScript 6","jsonpath","dataview","tacit","wordbreak","eslint","babel-core","transpile","sigint","concatMap","form-validation","map","lint","browser","commander","helpers","request","flatMap","getPrototypeOf","extra","walking","character","password","pyyaml","compiler","ast","Uint16Array","open","groupBy","define","airbnb","findLast","BigUint64Array","negative zero","queue","plugin","reduce","const","es-shim API","tostringtag","Push","babel","mime-db","language","Array.prototype.findLastIndex","data","width","file","react pose","protobuf","crypto","fast-deep-copy","styling","String.prototype.trim","copy","wordwrap","accessor","exit","fastclone","optimist","glob","censor","postcss","bluebird","optimizer","jQuery","chromium","ecmascript","String.prototype.matchAll","Promise","moment","stateless","__proto__","-0","json-schema","tty","encryption","ESnext","api","typed array","inference","stream","wait","react","collection.es6","argument","compare","fastify","recursive","resolve","assign","Array.prototype.flat","hash","properties","testing","number","internal slot","bootstrap less","once","npm","setImmediate","es-shims","extend","value","JSON-Schema","qs","querystring","channel","nope","var","omit","RegExp#flags","pure","a11y","lesscss","react-hook-form","transpiler","writable","runtime","fixed-width","polyfill","framework","@@toStringTag","Symbol.toStringTag","utility","metadata","css variable","require","spec","ECMAScript 2018","modules","drop","readablestream","variables in css","stringify","classes","ECMAScript 2020","less compiler","user-streams","circular","regular expression","tools","less","functional","minimal","characters","ArrayBuffer#slice","variables","remove","javascript","json-schema-validation","eslint-plugin","diff","middleware","zod","let","negative","filter","styleguide","ReactiveX","getOwnPropertyDescriptor","walk","ECMAScript 2023","pnpm9","folder","Array.prototype.includes","date","watching","mru","regular","classname","has","windows","property","argparse","output","xss","weakmap","gradients css3","structuredClone","Reflect.getPrototypeOf","serialization","description","private","matchAll","parser","ArrayBuffer","Float64Array","guid","auth","typesafe","bind","sharedarraybuffer","unicode","Observables","key","rm -rf","flat","codes","less.js","Int32Array","callbound","getintrinsic","fantasy-land","rapid","point-free","string","native","es6","sameValueZero","gestures","east-asian-width","flatten","styled-components","config","Object.fromEntries","util.inspect","Object.assign","validator","nested css","ratelimit","invariant","es2015","hasOwn","collection","Object.entries","superstruct","watch","serializer","react-testing-library","file system","hardlinks","autoprefixer","isConcatSpreadable","styles","redact","eslintconfig","rate","telephone","ES2016","which","concurrency","name","colour","whatwg","waapi","length","toArray","datastructure","set","$.extend","deep-clone","command","WeakSet","byteLength","ES2015","json","Observable","preserve-symlinks","private data","console","ansi","Symbol","hooks","toSorted","regular expressions","vest","react-hooks","Array.prototype.flatten","toStringTag","status","regex","module","WeakMap","cors","Object.keys","object","ECMAScript 5","weakset","computed-types","Int16Array","ES2023","URL","progress","browserlist","ava","express","Function.prototype.name","signals","descriptors","trimEnd","util","css-in-js","6to5","events","names","dependencies","reuse","flags","protocol-buffers","environment","mimetypes","logger","listeners","core","emoji","es","superagent","es7","format","es2016","Object.values","type","tc39","higher-order","ECMAScript 3","stable","css less","positive","debug","sorted","rm","args","text","exit-code","inspect","BigInt64Array","traverse","japanese","0","byte","last","types","shim","operating-system","mkdir","scheme","shared","iteration","prop","AsyncIterator","lockfile","mocha","match","symlinks","group","dom","trimLeft","parse","immer","call-bind","duplex","ES2019","sanitization","less mixins","typanion","3d","delete","arktype","mixins","URLSearchParams","shell","jwt","validation","Object.defineProperty","search","mkdirp","intrinsic","package manager","merge","Object.is","dom-testing-library","WebSockets","connect","dayjs","gdpr","Map","yup","mobile","parent","ECMAScript 2016","256","warning","offset","ES5","promise","uuid","quote","efficient","react animation","ajax","karma","make dir","wget","watchFile","fast-clone","watcher","ES8","path","fast-copy","break","schema","libphonenumber","deep","apollo","jsdiff"],"repository":{"type":"git","url":"git+https://github.com/crabas0npm/sint-minima-sint.git"},"homepage":"https://github.com/crabas0npm/sint-minima-sint/#readme","bugs":{"url":"https://github.com/crabas0npm/sint-minima-sint/issues"},"packageManager":"yarn@4.1.1","_id":"@crabas0npm/sint-minima-sint@1.0.0","gitHead":"1689908e328ee5add568cd2b91e500833028cadc","_nodeVersion":"20.12.2","_npmVersion":"10.5.0","dist":{"integrity":"sha512-dOv+FxZDy036eJB20c/jlGTWlRbXYFsVxXjuX1NahoeOIux/Abrf+697tWaS6j1rxlKXGYhLeA6sgo1ocnfhjw==","shasum":"db176873cb078fd4ce60ba2e7b985b5fa33f32a3","tarball":"https://registry.npmjs.org/@crabas0npm/sint-minima-sint/-/sint-minima-sint-1.0.0.tgz","fileCount":10,"unpackedSize":67179,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCViyX+0CtBo8/wJjR17UZl0CwjUOyTzkoIFwahT4FnRgIhAJdIqC4idWjKuLpfb7h4csHmxkqC4DZKrMsGQgIgWhba"}]},"_npmUser":{"name":"thanhl4861","email":"thanhl4861@gmail.com"},"directories":{},"maintainers":[{"name":"thanhl4861","email":"thanhl4861@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sint-minima-sint_1.0.0_1714211828248_0.8175346425656338"},"_hasShrinkwrap":false}},"time":{"created":"2024-04-27T09:57:08.142Z","1.0.0":"2024-04-27T09:57:08.388Z","modified":"2024-04-27T09:57:08.774Z"},"maintainers":[{"name":"thanhl4861","email":"thanhl4861@gmail.com"}],"description":"[![NPM](http://img.shields.io/npm/v/@crabas0npm/sint-minima-sint.svg?style=flat-square)](https://www.npmjs.com/package/@crabas0npm/sint-minima-sint)","homepage":"https://github.com/crabas0npm/sint-minima-sint/#readme","keywords":["graphql","package.json","arraybuffer","jsx","make","shebang","obj","framer","sham","macos","classnames","deep-copy","syntaxerror","client","idle","signal","interrupts","proto","findup","fast-deep-clone","ES3","debugger","TypeBox","https","ES","dir","Array","performant","WebSocket","up","side","rangeerror","performance","ES2020","HyBi","ascii","pose","streams2","picomatch","look","prune","web","from","touch","animation","columns","handlers","art","command-line","chai","import","deterministic","CSS","env","Array.prototype.contains","settings","tslib","trimStart","promises","defineProperty","preprocessor","Microsoft","lru","ReactiveExtensions","bcrypt","column","ECMAScript 2015","consume","color","callbind","ECMAScript 2017","typescript","form","random","ramda","find-up","find","redux-toolkit","link","descriptor","linewrap","[[Prototype]]","task","awesomesauce","argv","getter","formatting","curried","getopt","full-width","immutable","buffer","typed","Set","linux","jsonschema","findLastIndex","streams","valid","Object.getPrototypeOf","dotenv","readable","Array.prototype.findLast","real-time","tdd","batch","sanitize","is","deepclone","ECMAScript 2021","cjk","fsevents","bdd","compile less","logging","sort","limited","configurable","TypeScript","electron","postcss-plugin","authentication","slice","es8","fast","await","move","rm -fr","tape","cli","arrays","contains","matches","setPrototypeOf","time","directory","JSON","call","exec","popmotion","utils","sequence","jasmine","pipe","starter","serialize","fetch","ArrayBuffer.prototype.slice","reducer","es2017","iterate","install","visual","nodejs","ts","RFC-6455","korean","setter","accessibility","ES2018","package","CSSStyleDeclaration","toolkit","css nesting","ie","view","speed","bundling","log","prefix","byteOffset","zero","forms","typeerror","regexp","bootstrap css","coercible","every","loading","expression","sigterm","keys","ES7","installer","yaml","Uint8Array","check","take","functions","shrinkwrap","ECMAScript 7","packages","tap","jsdom","equal","terminal","three","js","clone","core-js","error","Object","pretty","busy","robust","symbols","Underscore","mkdirs","Array.prototype.flatMap","figlet","ender","class-validator","YAML","xhr","spring","test","call-bound","mime","flag","prototype",".env","ES2021","array","colors","escape","phone","forEach","uninstall","indicator","browserslist","Float32Array","es2018","joi","drag","get","typedarrays","stringifier","_.extend","bound","symlink","trimRight","option","write","syntax","safe","push","tester","error-handling","stdlib","fs","symbol","function","buffers","TypedArray","json-schema-validator","wrap","redux","ES2022","stylesheet","queueMicrotask","assertion","node","Rx","lazy","RegExp.prototype.flags","fastcopy","monorepo","bundler","harmony","callback","gradients css","typedarray","Streams","toobject","iterator","rmdir","ECMAScript 6","jsonpath","dataview","tacit","wordbreak","eslint","babel-core","transpile","sigint","concatMap","form-validation","map","lint","browser","commander","helpers","request","flatMap","getPrototypeOf","extra","walking","character","password","pyyaml","compiler","ast","Uint16Array","open","groupBy","define","airbnb","findLast","BigUint64Array","negative zero","queue","plugin","reduce","const","es-shim API","tostringtag","Push","babel","mime-db","language","Array.prototype.findLastIndex","data","width","file","react pose","protobuf","crypto","fast-deep-copy","styling","String.prototype.trim","copy","wordwrap","accessor","exit","fastclone","optimist","glob","censor","postcss","bluebird","optimizer","jQuery","chromium","ecmascript","String.prototype.matchAll","Promise","moment","stateless","__proto__","-0","json-schema","tty","encryption","ESnext","api","typed array","inference","stream","wait","react","collection.es6","argument","compare","fastify","recursive","resolve","assign","Array.prototype.flat","hash","properties","testing","number","internal slot","bootstrap less","once","npm","setImmediate","es-shims","extend","value","JSON-Schema","qs","querystring","channel","nope","var","omit","RegExp#flags","pure","a11y","lesscss","react-hook-form","transpiler","writable","runtime","fixed-width","polyfill","framework","@@toStringTag","Symbol.toStringTag","utility","metadata","css variable","require","spec","ECMAScript 2018","modules","drop","readablestream","variables in css","stringify","classes","ECMAScript 2020","less compiler","user-streams","circular","regular expression","tools","less","functional","minimal","characters","ArrayBuffer#slice","variables","remove","javascript","json-schema-validation","eslint-plugin","diff","middleware","zod","let","negative","filter","styleguide","ReactiveX","getOwnPropertyDescriptor","walk","ECMAScript 2023","pnpm9","folder","Array.prototype.includes","date","watching","mru","regular","classname","has","windows","property","argparse","output","xss","weakmap","gradients css3","structuredClone","Reflect.getPrototypeOf","serialization","description","private","matchAll","parser","ArrayBuffer","Float64Array","guid","auth","typesafe","bind","sharedarraybuffer","unicode","Observables","key","rm -rf","flat","codes","less.js","Int32Array","callbound","getintrinsic","fantasy-land","rapid","point-free","string","native","es6","sameValueZero","gestures","east-asian-width","flatten","styled-components","config","Object.fromEntries","util.inspect","Object.assign","validator","nested css","ratelimit","invariant","es2015","hasOwn","collection","Object.entries","superstruct","watch","serializer","react-testing-library","file system","hardlinks","autoprefixer","isConcatSpreadable","styles","redact","eslintconfig","rate","telephone","ES2016","which","concurrency","name","colour","whatwg","waapi","length","toArray","datastructure","set","$.extend","deep-clone","command","WeakSet","byteLength","ES2015","json","Observable","preserve-symlinks","private data","console","ansi","Symbol","hooks","toSorted","regular expressions","vest","react-hooks","Array.prototype.flatten","toStringTag","status","regex","module","WeakMap","cors","Object.keys","object","ECMAScript 5","weakset","computed-types","Int16Array","ES2023","URL","progress","browserlist","ava","express","Function.prototype.name","signals","descriptors","trimEnd","util","css-in-js","6to5","events","names","dependencies","reuse","flags","protocol-buffers","environment","mimetypes","logger","listeners","core","emoji","es","superagent","es7","format","es2016","Object.values","type","tc39","higher-order","ECMAScript 3","stable","css less","positive","debug","sorted","rm","args","text","exit-code","inspect","BigInt64Array","traverse","japanese","0","byte","last","types","shim","operating-system","mkdir","scheme","shared","iteration","prop","AsyncIterator","lockfile","mocha","match","symlinks","group","dom","trimLeft","parse","immer","call-bind","duplex","ES2019","sanitization","less mixins","typanion","3d","delete","arktype","mixins","URLSearchParams","shell","jwt","validation","Object.defineProperty","search","mkdirp","intrinsic","package manager","merge","Object.is","dom-testing-library","WebSockets","connect","dayjs","gdpr","Map","yup","mobile","parent","ECMAScript 2016","256","warning","offset","ES5","promise","uuid","quote","efficient","react animation","ajax","karma","make dir","wget","watchFile","fast-clone","watcher","ES8","path","fast-copy","break","schema","libphonenumber","deep","apollo","jsdiff"],"repository":{"type":"git","url":"git+https://github.com/crabas0npm/sint-minima-sint.git"},"author":{"name":"Crabas0"},"bugs":{"url":"https://github.com/crabas0npm/sint-minima-sint/issues"},"license":"MIT","readme":"[![NPM](http://img.shields.io/npm/v/@crabas0npm/sint-minima-sint.svg?style=flat-square)](https://www.npmjs.com/package/@crabas0npm/sint-minima-sint)\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 `@crabas0npm/sint-minima-sint`.\n\n## Installation\n\n1. Install [npm][1]\n2. `npm install @crabas0npm/sint-minima-sint`\n\nor save `@crabas0npm/sint-minima-sint` as a dependency of your project with\n\n    npm install --save @crabas0npm/sint-minima-sint\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  - [@crabas0npm/sint-minima-sint.db.create(name, [callback])](#@crabas0npm/sint-minima-sintdbcreatename-callback)\n  - [@crabas0npm/sint-minima-sint.db.get(name, [callback])](#@crabas0npm/sint-minima-sintdbgetname-callback)\n  - [@crabas0npm/sint-minima-sint.db.destroy(name, [callback])](#@crabas0npm/sint-minima-sintdbdestroyname-callback)\n  - [@crabas0npm/sint-minima-sint.db.list([callback])](#@crabas0npm/sint-minima-sintdblistcallback)\n  - [@crabas0npm/sint-minima-sint.db.listAsStream()](#@crabas0npm/sint-minima-sintdblistasstream)\n  - [@crabas0npm/sint-minima-sint.db.compact(name, [designname], [callback])](#@crabas0npm/sint-minima-sintdbcompactname-designname-callback)\n  - [@crabas0npm/sint-minima-sint.db.replicate(source, target, [opts], [callback])](#@crabas0npm/sint-minima-sintdbreplicatesource-target-opts-callback)\n  - [@crabas0npm/sint-minima-sint.db.replication.enable(source, target, [opts], [callback])](#@crabas0npm/sint-minima-sintdbreplicationenablesource-target-opts-callback)\n  - [@crabas0npm/sint-minima-sint.db.replication.query(id, [opts], [callback])](#@crabas0npm/sint-minima-sintdbreplicationenablesource-target-opts-callback)\n  - [@crabas0npm/sint-minima-sint.db.replication.disable(id, [opts], [callback])](#@crabas0npm/sint-minima-sintdbreplicationdisableid-opts-callback)\n  - [@crabas0npm/sint-minima-sint.db.changes(name, [params], [callback])](#@crabas0npm/sint-minima-sintdbchangesname-params-callback)\n  - [@crabas0npm/sint-minima-sint.db.changesAsStream(name, [params])](#@crabas0npm/sint-minima-sintdbchangesasstreamname-params)\n  - [@crabas0npm/sint-minima-sint.db.info([callback])](#@crabas0npm/sint-minima-sintdbinfocallback)\n  - [@crabas0npm/sint-minima-sint.use(name)](#@crabas0npm/sint-minima-sintusename)\n  - [@crabas0npm/sint-minima-sint.request(opts, [callback])](#@crabas0npm/sint-minima-sintrequestopts-callback)\n  - [@crabas0npm/sint-minima-sint.config](#@crabas0npm/sint-minima-sintconfig)\n  - [@crabas0npm/sint-minima-sint.updates([params], [callback])](#@crabas0npm/sint-minima-sintupdatesparams-callback)\n  - [@crabas0npm/sint-minima-sint.info([callback])](#@crabas0npm/sint-minima-sintinfocallback)\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 @crabas0npm/sint-minima-sint](#extending-@crabas0npm/sint-minima-sint)\n  - [pipes](#pipes)\n- [Tests](#tests)\n- [Release](#release)\n\n## Getting started\n\nTo use `@crabas0npm/sint-minima-sint` you need to connect it to your CouchDB install, to do that:\n\n```js\nconst @crabas0npm/sint-minima-sint = require('@crabas0npm/sint-minima-sint')('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\n@crabas0npm/sint-minima-sint.db.create('alice');\n```\n\nand to use an existing database:\n\n```js\nconst alice = @crabas0npm/sint-minima-sint.db.use('alice');\n```\n\nUnder-the-hood, calls like `@crabas0npm/sint-minima-sint.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\n@crabas0npm/sint-minima-sint.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 @crabas0npm/sint-minima-sint.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\n@crabas0npm/sint-minima-sint.db.create('alice', (err, data) => {\n  // errors are in 'err' & response is in 'data'\n})\n```\n\nIn `@crabas0npm/sint-minima-sint` 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 @crabas0npm/sint-minima-sint.db.destroy('alice')\n  await @crabas0npm/sint-minima-sint.db.create('alice')\n  const alice = @crabas0npm/sint-minima-sint.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 @crabas0npm/sint-minima-sint to use your database server is as simple as:\n\n```js\nconst @crabas0npm/sint-minima-sint = require('@crabas0npm/sint-minima-sint')('http://localhost:5984')\nconst db = @crabas0npm/sint-minima-sint.use('foo');\n```\n\nIf you don't need to instrument database objects you can simply:\n\n```js\n// @crabas0npm/sint-minima-sint parses the URL and knows this is a database\nconst db = require('@crabas0npm/sint-minima-sint')('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// @crabas0npm/sint-minima-sint 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('@crabas0npm/sint-minima-sint')(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 @crabas0npm/sint-minima-sint = 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 @crabas0npm/sint-minima-sint to not parse the URL (maybe the server is behind a proxy, is accessed through a rewrite rule or other):\n\n```js\n// @crabas0npm/sint-minima-sint does not parse the URL and return the server api\n// \"http://localhost:5984/prefix\" is the CouchDB server root\nconst couch = require('@crabas0npm/sint-minima-sint')(\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 `@crabas0npm/sint-minima-sint` 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('@crabas0npm/sint-minima-sint')({\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 *@crabas0npm/sint-minima-sint* package. Your TypeScript editor will show you hints as you write your code with the *@crabas0npm/sint-minima-sint* library with your own custom classes:\n\n```ts\nimport * as Nano  from '@crabas0npm/sint-minima-sint'\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### @crabas0npm/sint-minima-sint.db.create(name, [opts], [callback])\n\nCreates a CouchDB database with the given `name`, with options `opts`.\n\n```js\nawait @crabas0npm/sint-minima-sint.db.create('alice', { n: 3 })\n```\n\n### @crabas0npm/sint-minima-sint.db.get(name, [callback])\n\nGet information about the database `name`:\n\n```js\nconst info = await @crabas0npm/sint-minima-sint.db.get('alice')\n```\n\n### @crabas0npm/sint-minima-sint.db.destroy(name, [callback])\n\nDestroys the database `name`:\n\n```js\nawait @crabas0npm/sint-minima-sint.db.destroy('alice')\n```\n\n### @crabas0npm/sint-minima-sint.db.list([callback])\n\nLists all the CouchDB databases:\n\n```js\nconst dblist = await @crabas0npm/sint-minima-sint.db.list()\n```\n\n### @crabas0npm/sint-minima-sint.db.listAsStream()\n\nLists all the CouchDB databases as a stream:\n\n```js\n@crabas0npm/sint-minima-sint.db.listAsStream()\n  .on('error', (e) => console.error('error', e))\n  .pipe(process.stdout);\n```\n\n### @crabas0npm/sint-minima-sint.db.compact(name, [designname], [callback])\n\nCompacts `name`, if `designname` is specified also compacts its views.\n\n### @crabas0npm/sint-minima-sint.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 @crabas0npm/sint-minima-sint.db.replicate('alice',\n                  'http://admin:password@otherhost.com:5984/alice',\n                  { create_target:true })\n```\n\n### @crabas0npm/sint-minima-sint.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 @crabas0npm/sint-minima-sint.db.replication.enable('alice',\n                  'http://admin:password@otherhost.com:5984/alice',\n                  { create_target:true })\n```\n\n### @crabas0npm/sint-minima-sint.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 @crabas0npm/sint-minima-sint.db.replication.enable('alice',\n                  'http://admin:password@otherhost.com:5984/alice',\n                   { create_target:true })\nconst q = await @crabas0npm/sint-minima-sint.db.replication.query(r.id)\n```\n\n### @crabas0npm/sint-minima-sint.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 @crabas0npm/sint-minima-sint.db.replication.enable('alice',\n                   'http://admin:password@otherhost.com:5984/alice',\n                   { create_target:true })\nawait @crabas0npm/sint-minima-sint.db.replication.disable(r.id);\n```\n\n### @crabas0npm/sint-minima-sint.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 @crabas0npm/sint-minima-sint.db.changes('alice')\n```\n\n### @crabas0npm/sint-minima-sint.db.changesAsStream(name, [params])\n\nSame as `@crabas0npm/sint-minima-sint.db.changes` but returns a stream.\n\n```js\n@crabas0npm/sint-minima-sint.db.changes('alice').pipe(process.stdout);\n```\n\n### @crabas0npm/sint-minima-sint.db.info([callback])\n\nGets database information:\n\n```js\nconst info = await @crabas0npm/sint-minima-sint.db.info()\n```\n\n### @crabas0npm/sint-minima-sint.use(name)\n\nReturns a database object that allows you to perform operations against that database:\n\n```js\nconst alice = @crabas0npm/sint-minima-sint.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### @crabas0npm/sint-minima-sint.db.use(name)\n\nAlias for `@crabas0npm/sint-minima-sint.use`\n\n### @crabas0npm/sint-minima-sint.db.scope(name)\n\nAlias for `@crabas0npm/sint-minima-sint.use`\n\n### @crabas0npm/sint-minima-sint.scope(name)\n\nAlias for `@crabas0npm/sint-minima-sint.use`\n\n### @crabas0npm/sint-minima-sint.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 `@crabas0npm/sint-minima-sint` 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### @crabas0npm/sint-minima-sint.relax(opts, [callback])\n\nAlias for `@crabas0npm/sint-minima-sint.request`\n\n### @crabas0npm/sint-minima-sint.config\n\nAn object containing the `@crabas0npm/sint-minima-sint` configurations, possible keys are:\n\n* `url` - the CouchDB URL\n* `db` - the database name\n\n### @crabas0npm/sint-minima-sint.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### @crabas0npm/sint-minima-sint.info([callback])\n\nFetch information about the CouchDB cluster:\n\n```js\nconst info = await @crabas0npm/sint-minima-sint.info()\n```\n\nThe response is an object with [CouchDB cluster information](https://docs.couchdb.org/en/stable/intro/api.html#server).\n\n## Document functions\n\n### db.insert(doc, [params], [callback])\n\nInserts `doc` in the database with optional `params`. If params is a string, it's assumed it is the intended document `_id`. If params is an object, it's passed as query string parameters and `docName` is checked for defining the document `_id`:\n\n```js\nconst alice = @crabas0npm/sint-minima-sint.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 = @crabas0npm/sint-minima-sint.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 = @crabas0npm/sint-minima-sint.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-@crabas0npm/sint-minima-sint#dbmultipartgetdocname-params-callback)\nand parse the returned buffer to get the document and attachments.\n\nSee the [attachments methods](https://github.com/crabas0npm/sint-minima-sint#attachments-functions) to retrieve\n*just* an attachment.\n\n### db.head(docname, [callback])\n\nSame as `get` but lightweight version that returns headers only:\n\n```js\nconst headers = await alice.head('rabbit')\n```\n\n*Note:* if you call `alice.head` in the callback style, the headers are returned to you as the third argument of the callback function.\n\n### db.bulk(docs, [params], [callback])\n\nBulk operations(update/delete/insert) on the database, refer to the\n[CouchDB doc](https://docs.couchdb.org/en/stable/api/database/bulk-api.html#post--db-_bulk_docs) e.g:\n\n```js\nconst documents = [\n  { a:1, b:2 },\n  { _id: 'tiger', striped: true}\n];\nconst response = await alice.bulk({ docs: documents })\n```\n\n### db.list([params], [callback])\n\nList all the docs in the database .\n\n```js\nconst doclist = await alice.list().then((body)=>{\n    body.rows.forEach((doc) => {\n        console.log(doc);\n    })\n});\n```\n\nor with optional query string additions `params`:\n\n```js\nconst doclist = await alice.list({include_docs: true})\n```\n\n### db.listAsStream([params])\n\nList all the docs in the database as a stream.\n\n```js\nalice.listAsStream()\n  .on('error', (e) => 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 = @crabas0npm/sint-minima-sint.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 @crabas0npm/sint-minima-sint.db.create('my-partitioned-db', { partitioned: true })\n```\n\nThe database can be used as normal:\n\n```js\nconst db = @crabas0npm/sint-minima-sint.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\n@crabas0npm/sint-minima-sint.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\n@crabas0npm/sint-minima-sint.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 `@crabas0npm/sint-minima-sint.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 @crabas0npm/sint-minima-sint = require('@crabas0npm/sint-minima-sint')({\n  url: 'http://localhost:5984',\n  requestDefaults: {\n    jar: true\n  }\n})\nconst username = 'user'\nconst userpass = 'pass'\nconst db = @crabas0npm/sint-minima-sint.db.use('mydb')\n\n// authenticate\nawait @crabas0npm/sint-minima-sint.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 `@crabas0npm/sint-minima-sint` library has remembered the `AuthSession` cookie that was invisibily returned by the `@crabas0npm/sint-minima-sint.auth` call.\n\nWhen you have a session, you can see what permissions you have by calling the `@crabas0npm/sint-minima-sint.session` function\n\n```js\nconst doc = await @crabas0npm/sint-minima-sint.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 @crabas0npm/sint-minima-sint.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 @crabas0npm/sint-minima-sint\n\n`@crabas0npm/sint-minima-sint` is minimalistic but you can add your own features with\n`@crabas0npm/sint-minima-sint.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 @crabas0npm/sint-minima-sint.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 @crabas0npm/sint-minima-sint 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 @crabas0npm/sint-minima-sint = require('@crabas0npm/sint-minima-sint')('http://127.0.0.1:5984/');\nconst alice = @crabas0npm/sint-minima-sint.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- @crabas0npm/sint-minima-sint.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 @crabas0npm/sint-minima-sint = 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 === '@crabas0npm/sint-minima-sint') {\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 @crabas0npm/sint-minima-sint = 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: [@crabas0npm/sint-minima-sint - a minimalistic CouchDB client for nodejs](https://writings.nunojob.com/2011/08/@crabas0npm/sint-minima-sint-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: [@crabas0npm/sint-minima-sint 3](https://writings.nunojob.com/2012/05/Nano-3.html)\n* article: [how to update a document with @crabas0npm/sint-minima-sint](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: [@crabas0npm/sint-minima-sintblog](https://github.com/grabbeh/@crabas0npm/sint-minima-sintblog)\n\n## Roadmap\n\nCheck [issues][2]\n\n## Tests\n\nTo run (and configure) the test suite simply:\n\n``` sh\ncd @crabas0npm/sint-minima-sint\nnpm install\nnpm run test\n```\n\n## Meta\n\n* code: `git clone git://github.com/apache/couchdb-@crabas0npm/sint-minima-sint.git`\n* home: <https://github.com/crabas0npm/sint-minima-sint>\n* bugs: <https://github.com/crabas0npm/sint-minima-sint/issues>\n* chat: [Freenode IRC @ #couchdb-dev][8]\n\n[1]: https://npmjs.org\n[2]: https://github.com/crabas0npm/sint-minima-sint/issues\n[4]: https://github.com/crabas0npm/sint-minima-sint/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 @crabas0npm/sint-minima-sint. 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"}