mongodb-js / is-mongodb-running

Is MongoDB running? What port is it using?
Apache License 2.0
3 stars 3 forks source link

Add windows support #7

Closed addisonElliott closed 6 years ago

addisonElliott commented 6 years ago

Same general premise is used to determine whether MongoDB is running on Windows.

node-netstat package is used to determine whether mongod is running on a given port or PID. node-ps is used to determine if mongod.exe is in the list of processes. It contains support for Windows already.

Note: node-ps currently has issue that if mongodb.exe is executed under another user, then the process cannot be retrieved without administrative rights and that is not given in node-ps. There is a fix for this and I will be submitting a PR soon enough to resolve this. I think in majority of cases, mongod.exe should be run under same user hopefully.

Use Windows equivalent function to check whether mongodb is running. Netstat is used to get MongoDB for a given PID or process. If neither is given, all running processes are analyzed using ps.locate.

addisonElliott commented 6 years ago

Travis failed due to unrelated issues. These are fixed in #6

imlucas commented 6 years ago

Published in is-mongodb-running@0.2.0. Thanks!