Skip to content
Simple utility which waits until mongodb to come online
JavaScript
Latest commit 5058917 Mar 3, 2015 @arunoda 0.2.0
Failed to load latest commit information.
bin added initial version Sep 25, 2013
lib increased timeout to 2000 Oct 7, 2013
LICENSE added initial version Sep 25, 2013
README.md added initial version Sep 25, 2013
package.json 0.2.0 Mar 3, 2015

README.md

wait-for-mongo

Simple utility which waits until mongodb comes online

Installation

npm install -g wait-for-mongo

Usage

As a Command Line tool

wait-for-mongo <mongo url> <timeout millies>

Or

export MONGO_URL=<mongo url>
export TIMEOUT=<timeout millies>
wait-for-mongo

As a NodeJS module

var waitForMongo = require('wait-for-mongo');

waitForMongo("mongodb://localhost/comet", {timeout: 1000 * 60* 2}, function(err) {
  if(err) {
    console.log('timeout exceeded');
  } else {
    console.log('mongodb comes online');
  }
});
Something went wrong with that request. Please try again.