is-mongodb-running

1.0.2 • Public • Published

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

/is-mongodb-running/

    Package Sidebar

    Install

    npm i is-mongodb-running

    Weekly Downloads

    3,511

    Version

    1.0.2

    License

    Apache-2.0

    Unpacked Size

    20.5 kB

    Total Files

    9

    Last publish

    Collaborators

    • orechova
    • himanshusinghs
    • c-buckingham
    • mongo-j
    • mabaasit
    • alexander_schroll
    • chuck.kalmanek
    • mongodb-js-user
    • rueckstiess
    • durran
    • lerouxb
    • fredtruman
    • mbroadst
    • hswolff
    • satyasinha
    • matt_d_rat
    • rhysm
    • tomhollander
    • alena.khineika
    • jeff-allen-mongo
    • mmarcon
    • jonathan.balsano
    • mongodb-build
    • jack.weir
    • stennie
    • mcasimir
    • kristina.stefano
    • jarjee
    • shaketbaby
    • devtoolsbot
    • addaleax
    • gribnoysup
    • mutukrish
    • imlucas