Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nano

Package Overview
Dependencies
Maintainers
7
Versions
155
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nano - npm Package Compare versions

Comparing version 9.0.5 to 10.0.0

8

CONTRIBUTING.md

@@ -28,10 +28,4 @@ # Contributing to nano

To run tests, make sure you run `npm test` but also run tests without mocks:
To run tests, make sure you run `npm test`.
``` sh
npm run unmocked
npm run mocked
npm test
```
Please fix all issues identified in the pre-commit hooks before sending your patch. if you don't, we will close the patch and ask you to re-open it once you have:

@@ -38,0 +32,0 @@

22

lib/nano.js

@@ -137,7 +137,7 @@ // Licensed under the Apache License, Version 2.0 (the 'License'); you may not

if (reject) {
reject(new Error('error happened in your connection'))
reject(new Error(`error happened in your connection. Reason: ${response.message}`))
}
if (callback) {
const returnError = {
message: 'error happened in your connection',
message: `error happened in your connection. Reason: ${response.message}`,
scope: 'socket',

@@ -1040,3 +1040,3 @@ errid: 'request'

db: dbName,
path: '_partition/' + partitionKey
path: '_partition/' + encodeURIComponent(partitionKey)
}, callback)

@@ -1052,3 +1052,3 @@ }

db: dbName,
path: '_partition/' + partitionKey + '/_all_docs',
path: '_partition/' + encodeURIComponent(partitionKey) + '/_all_docs',
qs: opts

@@ -1061,3 +1061,3 @@ }, callback)

db: dbName,
path: '_partition/' + partitionKey + '/_all_docs',
path: '_partition/' + encodeURIComponent(partitionKey) + '/_all_docs',
qs: qs,

@@ -1075,3 +1075,3 @@ stream: true

db: dbName,
path: '_partition/' + partition + '/_find',
path: '_partition/' + encodeURIComponent(partition) + '/_find',
method: 'POST',

@@ -1085,3 +1085,3 @@ body: query

db: dbName,
path: '_partition/' + partition + '/_find',
path: '_partition/' + encodeURIComponent(partition) + '/_find',
method: 'POST',

@@ -1099,3 +1099,3 @@ body: query,

db: dbName,
path: '_partition/' + partition + '/_design/' + ddoc + '/_search/' + searchName,
path: '_partition/' + encodeURIComponent(partition) + '/_design/' + ddoc + '/_search/' + searchName,
qs: opts

@@ -1108,3 +1108,3 @@ }, callback)

db: dbName,
path: '_partition/' + partition + '/_design/' + ddoc + '/_search/' + searchName,
path: '_partition/' + encodeURIComponent(partition) + '/_design/' + ddoc + '/_search/' + searchName,
qs: opts,

@@ -1121,3 +1121,3 @@ stream: true

db: dbName,
path: '_partition/' + partition + '/_design/' + ddoc + '/_view/' + viewName,
path: '_partition/' + encodeURIComponent(partition) + '/_design/' + ddoc + '/_view/' + viewName,
qs: opts

@@ -1130,3 +1130,3 @@ }, callback)

db: dbName,
path: '_partition/' + partition + '/_design/' + ddoc + '/_view/' + viewName,
path: '_partition/' + encodeURIComponent(partition) + '/_design/' + ddoc + '/_view/' + viewName,
qs: opts,

@@ -1133,0 +1133,0 @@ stream: true

@@ -7,3 +7,3 @@ {

"repository": "http://github.com/apache/couchdb-nano",
"version": "9.0.5",
"version": "10.0.0",
"author": "Apache CouchDB <dev@couchdb.apache.org> (http://couchdb.apache.org)",

@@ -22,12 +22,12 @@ "keywords": [

"@types/tough-cookie": "^4.0.0",
"axios": "^0.21.1",
"axios": "^0.26.1",
"axios-cookiejar-support": "^1.0.1",
"qs": "^6.9.4",
"qs": "^6.10.3",
"tough-cookie": "^4.0.0"
},
"devDependencies": {
"@types/node": "^14.14.20",
"jest": "^26.6.3",
"nock": "^13.0.5",
"standard": "^16.0.3",
"@types/node": "^17.0.22",
"jest": "^27.5.1",
"nock": "^13.2.4",
"standard": "^16.0.4",
"typescript": "^4.1.3"

@@ -34,0 +34,0 @@ },

@@ -1,6 +0,6 @@

[![Build Status](https://travis-ci.org/apache/couchdb-nano.svg?branch=main)](https://travis-ci.org/apache/couchdb-nano)![Coverage](https://img.shields.io/badge/coverage-100%-ff69b4.svg)[![dependencies Status](https://david-dm.org/apache/couchdb-nano/status.svg)](https://david-dm.org/apache/couchdb-nano)[![NPM](http://img.shields.io/npm/v/nano.svg?style=flat-square)](https://www.npmjs.com/package/nano)
[![NPM](http://img.shields.io/npm/v/nano.svg?style=flat-square)](https://www.npmjs.com/package/nano)
# Nano
Offical [Apache CouchDB](http://couchdb.apache.org/) library for [Node.js](https://nodejs.org/).
Offical [Apache CouchDB](https://couchdb.apache.org/) library for [Node.js](https://nodejs.org/).

@@ -125,3 +125,3 @@ Features:

Under-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 recieve the asynchronous data back from the library
Under-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

@@ -193,3 +193,3 @@ 1) Promises

You can also see your document in [futon](http://localhost:5984/_utils).
You can also see your document in futon (http://localhost:5984/_utils).

@@ -218,5 +218,5 @@ ## Configuration

url: 'http://localhost:5984/foo',
requestDefaults: {
proxy: {
protocol: 'http',
requestDefaults: {
proxy: {
protocol: 'http',
host: 'myproxy.net'

@@ -274,6 +274,6 @@ },

const db = require('nano')({
const db = require('nano')({
url: 'http://localhost:5984/foo',
requestDefaults : {
agent : myagent
requestDefaults : {
agent : myagent
}

@@ -381,3 +381,3 @@ });

```js
const response = await nano.db.replicate('alice',
const response = await nano.db.replicate('alice',
'http://admin:password@otherhost.com:5984/alice',

@@ -394,3 +394,3 @@ { create_target:true })

```js
const response = await nano.db.replication.enable('alice',
const response = await nano.db.replication.enable('alice',
'http://admin:password@otherhost.com:5984/alice',

@@ -406,3 +406,3 @@ { create_target:true })

```js
const r = await nano.db.replication.enable('alice',
const r = await nano.db.replication.enable('alice',
'http://admin:password@otherhost.com:5984/alice',

@@ -419,3 +419,3 @@ { create_target:true })

```js
const r = await nano.db.replication.enable('alice',
const r = await nano.db.replication.enable('alice',
'http://admin:password@otherhost.com:5984/alice',

@@ -575,3 +575,3 @@ { create_target:true })

Bulk operations(update/delete/insert) on the database, refer to the
[CouchDB doc](http://docs.couchdb.org/en/2.1.1/api/database/bulk-api.html#db-bulk-docs) e.g:
[CouchDB doc](https://docs.couchdb.org/en/2.1.1/api/database/bulk-api.html#db-bulk-docs) e.g:

@@ -616,3 +616,3 @@ ```js

Bulk fetch of the database documents, `docnames` are specified as per
[CouchDB doc](http://docs.couchdb.org/en/latest/api/database/bulk-api.html#post--db-_all_docs).
[CouchDB doc](https://docs.couchdb.org/en/latest/api/database/bulk-api.html#post--db-_all_docs).
additional query string `params` can be specified, `include_docs` is always set

@@ -631,3 +631,3 @@ to `true`.

Bulk fetch of the revisions of the database documents, `docnames` are specified as per
[CouchDB doc](http://docs.couchdb.org/en/latest/api/database/bulk-api.html#post--db-_all_docs).
[CouchDB doc](https://docs.couchdb.org/en/latest/api/database/bulk-api.html#post--db-_all_docs).
additional query string `params` can be specified, this is the same method as fetch but

@@ -639,3 +639,3 @@ `include_docs` is not automatically set to `true`.

Create index on database fields, as specified in
[CouchDB doc](http://docs.couchdb.org/en/latest/api/database/find.html#db-index).
[CouchDB doc](https://docs.couchdb.org/en/latest/api/database/find.html#db-index).

@@ -686,3 +686,3 @@ ```js

console.log('a batch of', b.length, 'changes has arrived');
// do some asynchronous work here and call "changesReader.resume()"
// do some asynchronous work here and call "changesReader.resume()"
// when you're ready for the next API call to be dispatched.

@@ -708,3 +708,3 @@ // In this case, wait 5s before the next changes feed request.

| selector | Filters the changes feed with the supplied Mango selector | {"name":"fred} | null | |
| timeout | The number of milliseconds a changes feed request waits for data| 60000 | 10000
| timeout | The number of milliseconds a changes feed request waits for data| 60000 | 10000 |

@@ -751,3 +751,3 @@ The events it emits are as follows:s

Functions related to [partitioned databses](https://docs.couchdb.org/en/latest/partitioned-dbs/index.html).
Functions related to [partitioned databases](https://docs.couchdb.org/en/latest/partitioned-dbs/index.html).

@@ -789,3 +789,3 @@ Create a partitioned database by passing `{ partitioned: true }` to `db.create`:

}
// instruct CouchDB to create the index

@@ -803,3 +803,3 @@ await db.index(i)

}
// the design document containing the search definition function

@@ -827,3 +827,3 @@ const ddoc = {

}
// Design Document

@@ -842,3 +842,3 @@ const ddoc = {

}
// create design document

@@ -964,3 +964,3 @@ await db.insert(ddoc)

Inserts 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](http://wiki.apache.org/couchdb/HTTP_Document_API#Multiple_Attachments) for more details.
Inserts 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.
The `attachments` parameter must be an array of objects with `name`, `data` and `content_type` properties.

@@ -980,4 +980,3 @@

Get `docname` together with its attachments via `multipart/related` request with optional query string additions `params`. Refer to the
[doc](http://wiki.apache.org/couchdb/HTTP_Document_API#Getting_Attachments_With_a_Document) for more details. The multipart response body is a `Buffer`.
Get `docname` together with its attachments via `multipart/related` request with optional query string additions `params`. The multipart response body is a `Buffer`.

@@ -994,3 +993,3 @@ ```js

`params.rev` is required. Refer to the
[CouchDB doc](http://docs.couchdb.org/en/latest/api/document/attachments.html#db-doc-attachment) for more details.
[CouchDB doc](https://docs.couchdb.org/en/latest/api/document/attachments.html#db-doc-attachment) for more details.

@@ -1114,3 +1113,3 @@ ```js

Take a look at the [couchdb wiki](http://wiki.apache.org/CouchDB/Formatting_with_Show_and_List#Showing_Documents)
Take a look at the [CouchDB wiki](https://guide.couchdb.org/draft/show.html)
for possible query paramaters and more information on show functions.

@@ -1169,3 +1168,3 @@

Perform a ["Mango" query](http://docs.couchdb.org/en/2.1.1/api/database/find.html) by supplying a JavaScript object containing a selector:
Perform a ["Mango" query](https://docs.couchdb.org/en/2.1.1/api/database/find.html) by supplying a JavaScript object containing a selector:

@@ -1338,10 +1337,7 @@ ```js

* article: [nano - a minimalistic CouchDB client for nodejs](http://writings.nunojob.com/2011/08/nano-minimalistic-couchdb-client-for-nodejs.html)
* article: [getting started with Node.js and CouchDB](http://writings.nunojob.com/2011/09/getting-started-with-nodejs-and-couchdb.html)
* article: [document update handler support](http://jackhq.tumblr.com/post/16035106690/nano-v1-2-x-document-update-handler-support-v1-2-x)
* article: [nano 3](http://writings.nunojob.com/2012/05/Nano-3.html)
* article: [securing a site with CouchDB cookie authentication using Node.js and nano](http://codetwizzle.com/articles/couchdb-cookie-authentication-nodejs-nano/)
* article: [adding copy to nano](http://blog.jlank.com/2012/07/04/adding-copy-to-nano/)
* article: [how to update a document with nano](http://writings.nunojob.com/2012/07/How-To-Update-A-Document-With-Nano-The-CouchDB-Client-for-Node.js.html)
* article: [thoughts on development using CouchDB with Node.js](http://tbranyen.com/post/thoughts-on-development-using-couchdb-with-nodejs)
* article: [nano - a minimalistic CouchDB client for nodejs](https://writings.nunojob.com/2011/08/nano-minimalistic-couchdb-client-for-nodejs.html)
* article: [getting started with Node.js and CouchDB](https://writings.nunojob.com/2011/09/getting-started-with-nodejs-and-couchdb.html)
* article: [nano 3](https://writings.nunojob.com/2012/05/Nano-3.html)
* 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)
* article: [thoughts on development using CouchDB with Node.js](https://tbranyen.com/post/thoughts-on-development-using-couchdb-with-nodejs)
* example in the wild: [nanoblog](https://github.com/grabbeh/nanoblog)

@@ -1366,15 +1362,13 @@

* code: `git clone git://github.com/apache/couchdb-nano.git`
* home: <http://github.com/apache/couchdb-nano>
* bugs: <http://github.com/apache/couchdb-nano/issues>
* build: [![Build Status](https://travis-ci.org/apache/couchdb-nano.svg?branch=main)](https://travis-ci.org/apache/couchdb-nano)
* deps: [![dependencies Status](https://david-dm.org/apache/couchdb-nano/status.svg)](https://david-dm.org/apache/couchdb-nano)
* home: <https://github.com/apache/couchdb-nano>
* bugs: <https://github.com/apache/couchdb-nano/issues>
* chat: [Freenode IRC @ #couchdb-dev][8]
[1]: http://npmjs.org
[2]: http://github.com/apache/couchdb-nano/issues
[1]: https://npmjs.org
[2]: https://github.com/apache/couchdb-nano/issues
[4]: https://github.com/apache/couchdb-nano/blob/main/cfg/couch.example.js
[8]: http://webchat.freenode.net?channels=%23couchdb-dev
[8]: https://webchat.freenode.net?channels=%23couchdb-dev
[axios]: https://github.com/axios/axios
http://freenode.org/
https://freenode.org/

@@ -1381,0 +1375,0 @@ ## Release

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc