Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Simple utility which waits until mongodb to come online
JavaScript
branch: master

0.2.0

latest commit 505891791d
@arunoda authored
Failed to load latest commit information.
bin added initial version
lib increased timeout to 2000
LICENSE added initial version
README.md added initial version
package.json 0.2.0

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.