Closed utkapodsousom closed 1 year ago
You could try:
import Nano from 'nano';
const nano = Nano(process.env.COUCH_URL);
let db = nano.db.use('cities');
db.list({limit:5}).then(console.log)
I got this to work with the Typscript command:
tsc --esModuleInterop true test.ts
I tried your suggestion but it is giving me Cannot read properties of undefined (reading 'use')
import Nano from 'nano'
...
const nano = Nano(couchDbUrl)
console.log(Nano) // [Function: dbScope]
const nano = Nano(couchDbUrl)
console.log(nano)
The last log statement returns something conforming docScope
which does not have a use
method contrary to what the docs state.
I'm trying to get nano to work in my project. According to docs, if you want to import as module, you do:
Current Behavior
I get an error on the second line
TypeError: Nano is not a function
We all know it IS a function, however I cannot solve the issue.