mongodb-prebuilt
![badge](https://nodei.co/npm/mongodb-prebuilt.png?downloads=true)
Install mongodb prebuilt binaries for command-line use using npm. This module helps you easily install the mongodb
command for use on the command line 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 --save
You can also use the -g
flag (global) to symlink it into your PATH:
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"]);
mongodHelper.run().then((started) => {
console.log('mongod is running');
}, (e) => {
console.log('error starting', e);
});