Socket
Book a DemoInstallSign in
Socket

is-mongodb-running

Package Overview
Dependencies
Maintainers
28
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-mongodb-running

Is MongoDB running? What port is it using?

1.0.2
latest
Source
npmnpm
Version published
Weekly downloads
401
-24.48%
Maintainers
28
Weekly downloads
 
Created
Source

is-mongodb-running travis npm

Is MongoDB running? What port is it using?

Install

npm install -g is-mongodb-running;

Example

is-mongodb-running;
>>> ✔  Yep! 1 MongoDB instance(s) running:
>>>   1. port 27017 with pid 22873
kill 22873;
is-mongodb-running;
>>> ☹ No MongoDB instances running

You also might enjoy kill-mongodb.

Usage

Usage: is-mongodb-running [--port=<n> --pid=<pid>]

Is MongoDB running?  What port is it using?

Usage:
  is-mongodb-running

  # I know the port but I don't know the pid...
  is-mongodb-running --port=27017

  # I know the pid but I don't know the port...
  is-mongodb-running --pid=987


Options:
  --port=<n>     Port you think MongoDB is running on.
  --pid=<pid>    Pid you think MongoDB is running on.
  --json         Ouput results as json [Default: `false`].
  --debug        Enable debug messages.
  -h --help      Show this screen.
  --version      Show version.

Usage

require('is-mongodb-running')(function(err, res){
  if(err) return console.error(err);
  console.log(res);
  // >>> [{pid: <12345>, port: 27017}]
});

or, with promises:

require('is-mongodb-running/promise').then(function(res) {
  console.log(res);
  // >>> [{pid: <12345>, port: 27017}]
}).catch(function(err){
  return console.error(err);
});

License

Apache 2

FAQs

Package last updated on 09 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.