Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check node-mongodb-native driver version?

I am using official node-mongodb-native driver in my project. Which was installed by doing npm install mongodb. However I want to check its version but not sure how to do so.

There is nothing in the READ.ME file of that npm repo.

Please help.

Thanks.

like image 847
Nikhil Yeole Avatar asked Feb 14 '26 05:02

Nikhil Yeole


2 Answers

The version is exported in index.js:

exports.version = require('../../package').version;

So you can get it by requiring the module and accessing the version property:

var mongo = require('mongodb');
var version = mongo.version;

console.log(version);
like image 133
Gergo Erdosi Avatar answered Feb 17 '26 21:02

Gergo Erdosi


According to the npm documentation you can get a list of npm packages and their corresponding versions using npm ls or npm ls -g (for global)

like image 24
Ashoka Lella Avatar answered Feb 17 '26 21:02

Ashoka Lella



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!