Skip to content

Commit 26fb0e1

Browse files
authored
Use fetch instead of axios (#314)
* remove axios an use Node's built-in `fetch` for HTTP requests * remove callback support * make this Nano 11 and support only Node 20 and newer
1 parent ac8f4d0 commit 26fb0e1

File tree

80 files changed

+2634
-9641
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+2634
-9641
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
strategy:
2424
matrix:
25-
node-version: [16.x, 18.x]
25+
node-version: [20.x, 22.x]
2626

2727
steps:
2828
- uses: actions/checkout@v3

NOTICE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Apache CouchDB Nano
2-
Copyright [2016-2018] The Apache Software Foundation
2+
Copyright [2016-2024] The Apache Software Foundation
33

44
This product includes software developed at
55
The Apache Software Foundation (http://www.apache.org/).

README.md

Lines changed: 137 additions & 159 deletions
Large diffs are not rendered by default.

examples/bulk_transform.js

Lines changed: 0 additions & 46 deletions
This file was deleted.

examples/express.js

Lines changed: 0 additions & 29 deletions
This file was deleted.

examples/lazy_creation_of_views.js

Lines changed: 0 additions & 115 deletions
This file was deleted.

examples/lazy_db_creation_and_replication.js

Lines changed: 0 additions & 65 deletions
This file was deleted.

examples/pipe.js

Lines changed: 0 additions & 25 deletions
This file was deleted.

examples/readme.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

lib/changesreader.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const EventEmitter = require('events').EventEmitter
2-
const AbortController = global.AbortController || require('node-abort-controller').AbortController
2+
const AbortController = global.AbortController
33
const stream = require('stream')
44
const EVENT_BATCH = 'batch'
55
const EVENT_CHANGE = 'change'
@@ -279,6 +279,9 @@ class ChangesReader {
279279
const lin = liner()
280280
const cp = changeProcessor(self.ee, self.batchSize)
281281
self.request(req)
282+
.on(EVENT_ERROR, (e) => {
283+
self.ee.emit(EVENT_ERROR, e)
284+
})
282285
.pipe(lin)
283286
.pipe(cp)
284287
.on('finish', (lastSeq) => {
@@ -287,9 +290,6 @@ class ChangesReader {
287290
self.ee.emit('end', cp.lastSeq)
288291
}, 10)
289292
})
290-
.on(EVENT_ERROR, (e) => {
291-
self.ee.emit(EVENT_ERROR, e)
292-
})
293293

294294
return self.ee
295295
}

0 commit comments

Comments
 (0)