Extracts metadata from MongoDB's buildInfo command to determine deployment type: Atlas, Atlas Data Lake, Enterprise, DocumentDB, or CosmosDB. Also identifies localhost, DigitalOcean, and parse command-line options. Version 1.9.11 is stable and ships TypeScript definitions. Key differentiator: utility library for compass-tools, focused on genuine MongoDB detection and environment identification. Released under Apache-2.0 license. Maintained as part of the mongodb-js/devtools-shared monorepo.
npm install mongodb-build-infoNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Connects to MongoDB, retrieves buildInfo and cmdLineOpts, then uses mongodb-build-info to detect DataLake, Enterprise, and genuine MongoDB status.
Use getGenuineMongoDB with actual server responses for accurate server identity.
Always call getCmdLineOpts command and pass the result as second argument.
Use named imports like import { getDataLake } from 'mongodb-build-info'.Ensure count function returns a promise resolving to a number.
Use named import: import { getDataLake } from 'mongodb-build-info'Use: const { getGenuineMongoDB } = require('mongodb-build-info');Call admin.command({ getCmdLineOpts: 1 }) and pass the result as second argument.