wait-for-mongodb

0.3.3 • Public • Published

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 <mongodb url> <timeout in ms>

Or

export MONGO_URL=<mongodb url>
export TIMEOUT=<timeout in ms>
wait-for-mongo

As a NodeJS module

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

waitForMongo("mongodb://localhost/comet", {timeout: 1000 * 60* 2}, function(err) {
  if(err) {
    console.log('timeout');
  } else {
    console.log('mongodb is online');
  }
});

Dependents (0)

Package Sidebar

Install

npm i wait-for-mongodb

Weekly Downloads

53

Version

0.3.3

License

GPL-3.0

Last publish

Collaborators

  • mkg20001