Registry / database / wait-for-mongodb-slim

wait-for-mongodb-slim

JSON →
library1.0.3jsnpmunverified

Lightweight CLI tool that waits for a MongoDB server to be ready by repeatedly attempting a connection to the provided URI with a configurable retry interval. Version 1.0.3 (latest) offers a simple, no-dependency approach focusing solely on connection readiness. Unlike heavier alternatives like docker-compose wait scripts, this package provides a minimal, portable solution for CI/CD pipelines and orchestration scenarios where only connection availability is needed. Release cadence is low; no active development.

npm install wait-for-mongodb-slim
INSTALL
IMPORT
SIG · WAIT-FOR-MONGODB-S
W
wait-for-mongodb-slim
databasejavascriptv1.0.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

wait-for-mongodb-slim
npx wait-for-mongo --uri mongodb://localhost:27017/mydb
import { waitForMongo } from 'wait-for-mongodb-slim'
This is a CLI-only package; it cannot be imported as a module. Use npx or global install to run.

Waits for MongoDB to accept connections at URI mongodb://localhost:27017/test, checking every 2 seconds.

npx wait-for-mongodb-slim --uri mongodb://localhost:27017/test --t 2
Debug
Known issues
gotchaPackage is CLI-only and has no programmatic API. Cannot be used as a module in code.
fix
If you need a programmatic wait function, use a different library like wait-for-mongo (non-slim) or write your own.
affects: >=1.0.0
gotchaThe --t argument value is in seconds, but many users mistakenly assume milliseconds.
fix
Use --t with the number of seconds (e.g., --t 2 for 2 seconds).
affects: >=1.0.0
Errors
Common errors & fixes
command not found: wait-for-mongo
Package not installed globally or not using npx.
fix
Run with npx: npx wait-for-mongodb-slim --uri ...
Error: Invalid URI format
Missing or malformed MongoDB connection URI.
fix
Ensure URI is correct: mongodb://user:pass@host:port/db
Upgrade
Version history
1.0.3latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
28 hits · last 30 days
node
24
Meta
2
OpenAI (training)
1
Resources
wait-for-mongodb-slim — npm install wait-for-mongodb-slim · libregistry