A Node.js library to start and stop a local MongoDB server programmatically. Version 2.0.0 provides both callback and Promise APIs, supports configuration of port, binary path, dbpath, storage engine, and config file. Key differentiator: it manages the mongod process lifecycle within Node, emitting events like 'open' and 'closed', and exposes properties to check server state (isRunning, isOpening, isClosing). Release cadence appears irregular; last update was in 2018. Requires a mongod binary accessible via $PATH or explicitly configured.
npm install mongodNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a Mongod instance, starts the MongoDB server, and then stops it, using Promises.
Install MongoDB separately (e.g., via homebrew or official installer) and ensure mongod is in your PATH, or set 'bin' in the config.
Use the Promise-based API: server.open().then(...).catch(...); server.close().then(...).catch(...).
Either use a config file with all settings or use individual options, but not both.
Access it as server.isOpening, not server.isOpening().
Close any MongoDB client connections (e.g., mongoose.disconnect()) before calling server.close().
Install MongoDB locally or provide a valid path via the 'bin' option: new Mongod({ bin: '/usr/local/bin/mongod' })Use require('mongod') or enable esModuleInterop in TypeScript but note default import is not available.Choose a different port: new Mongod(27018) or configure port in options.
No dependency data recorded yet.