Coder Social home page Coder Social logo

is-mongodb-running's Introduction

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's People

Contributors

imlucas avatar addisonelliott avatar shum avatar pzrq avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.