Install MongoDB prebuilt package using npm https://npmjs.org/package/mongodb-prebuilt
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode redid project with typescript, however docs are still not done, and i… Feb 26, 2017
built
src Merge pull request #51 from xscheiner/develop Dec 1, 2018
.gitignore updated decopress Feb 10, 2016
LICENSE.md Add ISC license Nov 26, 2018
README.md Allow control over download options, esp mongo version Dec 1, 2018
helper.js redid project with typescript, however docs are still not done, and i… Feb 26, 2017
package-lock.json Bump mongodb-download to 2.2.7 Dec 3, 2018
package.json Bump mongodb-download to 2.2.7 Dec 3, 2018
tsconfig.json redid project with typescript, however docs are still not done, and i… Feb 26, 2017
tslint.json redid project with typescript, however docs are still not done, and i… Feb 26, 2017

README.md

mongodb-prebuilt

badge

Install mongodb prebuilt binaries using npm. This module helps you easily install the mongodb without having to compile anything.

MongoDB is an open-source, document database designed for ease of development and scaling.

Installation

Download and install the latest build of mongodb for your OS and add it to your projects package.json as a dependency:

npm install mongodb-prebuilt

--global to make MongoDB binaries accessible without additional configurations.

npm install -g mongodb-prebuilt

If that command fails with an EACCESS error you may have to run it again with sudo:

sudo npm install -g mongodb-prebuilt

Now you can just run mongod to run mongodb:

mongod

Complete list of programs:

About

Works on Mac, Windows, Linux and Solaris OSes that MongoDB supports.

Programmatic usage

let {MongodHelper} = require('mongodb-prebuilt');

let mongodHelper = new MongodHelper(['--port', "27018"]);

// OPTIONAL: to control what version of mongo you want to download

mongodHelper = new MongodHelper(['--port', "27018"], {
	version: 'x.x.x'
});

mongodHelper.run().then((started) => {
	console.log('mongod is running');
}, (e) => {
	console.log('error starting', e);
});