Registry / devops / mongodb-download-https

mongodb-download-https

JSON →
library2.2.6jsnpmunverified

A Node.js library and CLI tool for downloading prebuilt MongoDB binary packages (zip/tgz) from MongoDB's official download center. Current version 2.2.6, with low release cadence. Supports specifying version, architecture (ia32/x64), platform (win32, darwin, linux, etc.), and custom download directory. The package ships TypeScript declarations. Differentiator: it wraps the HTTPS download logic, allowing proxy agent injection for corporate environments. Integrates with testing tools like mongodb-memory-server.

npm install mongodb-download-https
INSTALL
IMPORT
SIG · MONGODB-DOWNLOAD-H
M
mongodb-download-https
devopsjavascriptv2.2.6
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.

MongoDBDownload
import { MongoDBDownload } from 'mongodb-download'
const mongodbDownload = require('mongodb-download')
Named export, not default. ESM works but CJS require returns all named exports as an object.
MongoDBDownload
const { MongoDBDownload } = require('mongodb-download')
const MongoDBDownload = require('mongodb-download')
CommonJS destructure required; direct require returns the module object, not the class.

Downloads MongoDB 3.0.6 for 64-bit Linux using the ES module syntax with TypeScript type support.

const { MongoDBDownload } = require('mongodb-download'); const downloader = new MongoDBDownload({ version: '3.0.6', arch: 'x64', platform: 'linux' }); downloader.download() .then((location) => { console.log(`Downloaded MongoDB to: ${location}`); }) .catch((err) => { console.error('Download failed:', err.message); });
Debug
Known issues
breakingIn version 2.x, the export changed from `MongoDBDownload` to a named export. Old `require('mongodb-download').MongoDBDownload` still works but is deprecated.
fix
Use `const { MongoDBDownload } = require('mongodb-download')` for CJS, or `import { MongoDBDownload } from 'mongodb-download'` for ESM.
affects: >=2.0.0
deprecatedThe `osx` platform value is deprecated in favor of `darwin`.
fix
Use `platform: 'darwin'` for macOS downloads.
affects: >=2.0.0
gotchaThe `http` option for proxy agents expects an `https-proxy-agent` instance, not a generic object. Incorrect agent will cause download failures.
fix
Use `const HttpsProxyAgent = require('https-proxy-agent'); new HttpsProxyAgent({ ... })` and pass as `http.agent`.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Request failed with status code 403
The download URL requires a valid User-Agent header or the resource is blocked.
fix
Ensure you are using a recent version of the package (2.2.6) which sets an appropriate User-Agent.
Error: Cannot find module 'mongodb-download'
Package not installed or incorrectly referenced in require/import.
fix
Run `npm install mongodb-download` and ensure your require path is correct.
TypeError: MongoDBDownload is not a constructor
Using default import instead of named import (CommonJS).
fix
Use `const { MongoDBDownload } = require('mongodb-download')` instead of `const MongoDBDownload = require('mongodb-download')`.
Upgrade
Version history
2.2.6latest on npm
Audit
Dependencies
debugrequiredLogging/debugging during download process
mkdirprequiredCreating download directories recursively
npmlogrequiredProgress logging for CLI usage
rimrafrequiredCleaning up partially downloaded files
Agent activity
8 hits · last 30 days
node
6
Amazon
1
Resources
mongodb-download-https — npm install mongodb-download-https · libregistry