# mongodb-prebuilt

> Install MongoDB prebuilt binaries via npm

Latest version **6.5.0** (published 2019-01-25) · ISC license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install mongodb-prebuilt
pnpm add mongodb-prebuilt
yarn add mongodb-prebuilt
bun add mongodb-prebuilt
```

Provides the commands `mongo`, `mongod`, `mongos`, `bsondump`, `mongotop`, `mongodump`, `mongoperf`, `mongostat`, `mongofiles`, `mongooplog`, `mongosniff`, `mongoexport`, `mongoimport`, `mongorestore`, `mongo-supervise`.

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 6.5.0 |
| Published | 2019-01-25 |
| First published | 2015-10-07 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 53.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 58 |
| Author | Roman Jurkov |
| Maintainers | compwright, lonerifle, winfinit |
| Keywords | mongodb, prebuilt, mongod, mongo, nosql, database, mongodb-prebuilt, mongodb prebuilt |

## Links

- npm: https://www.npmjs.com/package/mongodb-prebuilt
- Repository: https://github.com/winfinit/mongodb-prebuilt
- Homepage: https://github.com/winfinit/mongodb-prebuilt#readme
- Issues: https://github.com/winfinit/mongodb-prebuilt/issues
- npm.io page: https://npm.io/package/mongodb-prebuilt

## Dependencies (5)

- [glob](https://npm.io/package/glob.md) ^7.1.1
- [debug](https://npm.io/package/debug.md) ^2.2.0
- [yargs](https://npm.io/package/yargs.md) ^3.26.0
- [spawn-sync](https://npm.io/package/spawn-sync.md) 1.0.15
- [mongodb-download](https://npm.io/package/mongodb-download.md) ^2.2.7

## Alternatives

- [angular-pipes](https://npm.io/package/angular-pipes.md) — 5.6K weekly downloads
- [@ng-web-apis/midi](https://npm.io/package/@ng-web-apis/midi.md) — 2.6K weekly downloads
- [happn-3](https://npm.io/package/happn-3.md) — 1.6K weekly downloads
- [@opensip-cli/lang-go](https://npm.io/package/@opensip-cli/lang-go.md) — 1.2K weekly downloads
- [mongoose-typescript](https://npm.io/package/mongoose-typescript.md) — 85 weekly downloads

## Recent versions

- 6.5.0 (latest) — 2019-01-25
- 6.4.0 — 2018-12-03
- 6.3.6 — 2018-01-29
- 6.3.5 — 2018-01-25
- 6.3.4 — 2017-11-10
- 6.3.3 — 2017-06-06
- 6.3.2 — 2017-06-06
- 6.3.1 — 2017-04-20
- 6.3.0 — 2017-04-19
- 6.2.0 — 2017-04-01
- 6.1.0 — 2017-03-28
- 6.0.2 — 2017-03-12
- 6.0.1 — 2017-03-02
- 6.0.0 — 2017-03-01
- 6.0.0-rc2 — 2017-02-27
- … 52 more at https://npm.io/package/mongodb-prebuilt/versions

## README

# mongodb-prebuilt


![badge](https://nodei.co/npm/mongodb-prebuilt.png?downloads=true)

Install [mongodb](https://github.com/mongodb/mongo) 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:

- [bsondump](https://docs.mongodb.org/manual/reference/program/bsondump/)
- [mongo](https://docs.mongodb.org/manual/reference/program/mongo/)
- [mongod](https://docs.mongodb.org/manual/reference/program/mongod/)
- [mongodump](https://docs.mongodb.org/manual/reference/program/mongodump/)
- [mongoexport](https://docs.mongodb.org/manual/reference/program/mongoexport/)
- [mongofiles](https://docs.mongodb.org/manual/reference/program/mongofiles/)
- [mongoimport](https://docs.mongodb.org/manual/reference/program/mongoimport/)
- [mongooplog](https://docs.mongodb.org/manual/reference/program/mongooplog/)
- [mongoperf](https://docs.mongodb.org/manual/reference/program/mongoperf/)
- [mongorestore](https://docs.mongodb.org/manual/reference/program/mongorestore/)
- [mongos](https://docs.mongodb.org/manual/reference/program/mongos/)
- [mongosniff](https://docs.mongodb.org/manual/reference/program/mongosniff/)
- [mongostat](https://docs.mongodb.org/manual/reference/program/mongostat/)
- [mongotop](https://docs.mongodb.org/manual/reference/program/mongotop/)

## About

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

## CLI usage
The latest version of MongoDB is used by default for your OS and `~/.mongodb-prebuilt` for downloading MongoDB binary.
You can set desired version, download folder, architecture and platform through environment variables:
```
MONGODB_VERSION
MONGODB_DOWNLOADDIR
MONGODB_ARCH
MONGODB_PLATFORM
```
For example:
```
export MONGODB_DOWNLOADDIR='./' MONGODB_VERSION=3.4.10
mongod --port 27018 --dbpath ./mongodb --logpath /dev/stdout
```
## Programmatic usage

```javascript
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);
});

```

---
_Source: https://npm.io/package/mongodb-prebuilt · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
