thunderclient / thunder-client-support

Thunder Client is a lightweight Rest API Client Extension for VS Code.
https://www.thunderclient.com
Other
3.62k stars 127 forks source link

Loading external modules for scripting (MongoDB Access) #1442

Closed Artem0ne closed 5 months ago

Artem0ne commented 8 months ago

Question:

Hello Ranga,

i have few questions regards modules connections. I am trying to load module MongoDB:

  1. Via tc.loadModule: var MongoClientLoadModule = await tc.loadModule("mongodb") console.log(MongoClientLoadModule); Result: --> Script Log: Error loading node package: mongodb - Cannot find module 'timers'

  2. Via require const MongoClient = require('mongodb').MongoClient; console.log(MongoClient); Result: --> Error: require file path is not valid mongodb

It haven't brought any result..

Questions:

  1. From where (folders, external sources) ThunderClient is trying to get this library MongoDB?

  2. I have installed locally node.js and the driver mongoDВ image but ThunderClient does not see it. How to configure ThunderClient in order to use this node.js driver mongoDB in scripting?

  3. Is it possible to integrate this driver MongoDB in ThunderClient, like other libraries you had integrated before (e.g. chai, crypto-js) ?

Are you using the free version/paid version/trial: We use paid version (Deutsche Bahn AG, DB Systel GmbH, DB Netz AG)

rangav commented 8 months ago

Hi @Artem0ne

The module is loaded from npm registry.

Looks like this module is not supported for dynamic installing.

Will research if there is any workaround to fix it.

Artem0ne commented 7 months ago

Thank you! It could be a really nice feature. Some of our teams use other database connections, for example postgresql. For this the corresponding modules required. Do you have for this any ticket number or feature request number?

rangav commented 5 months ago

We have improved the loading of Node modules in the new update. Please update to v2.20.0.

You can see all the features released in this update https://github.com/rangav/thunder-client-support/releases/tag/v2.20.0

Please test it and let me know your feedback