In Nano 11, the requestDefaults option has been removed. To configure connection handling parameters (like timeouts or keep-alive settings), you must now use agentOptions.
Because Nano 11 uses the native Node.js fetch API, you must provide an instance of an undici.Agent via the undiciOptions key in the Nano configuration object. To do this, you must add undici as a dependency in your own project.
const agentOptions = {
bodyTimeout: 30000,
headersTimeout: 30000,
keepAliveMaxTimeout: 600000,
keepAliveTimeout: 30000,
keepAliveTimeoutThreshold: 1000,
maxHeaderSize: 16384,
maxResponseSize: -1,
pipelining: 6,
connect: {
timeout: 10000
},
strictContentLength: true,
connections: null,
maxRedirections: 0
}
const undici = require('undici')
const undiciOptions = new undici.Agent(agentOptions)
const nano = Nano({ url: 'http://127.0.0.1:5984', undiciOptions })