# mongod-run2

> Runs mongod. Useful when testing APIs.

Latest version **0.1.2** (published 2017-08-05) · Unlicense license · 0 weekly downloads

## Install

```sh
npm install mongod-run2
pnpm add mongod-run2
yarn add mongod-run2
bun add mongod-run2
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2017-08-05 |
| First published | 2017-08-05 |
| Weekly downloads | 0 |
| License | Unlicense |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| Author | Chris Crum |
| Maintainers | clcrum |
| Keywords | mongodb, mongod, run, mean, express |

## Links

- npm: https://www.npmjs.com/package/mongod-run2
- Repository: https://github.com/clcrum/mongod-run2
- Issues: https://github.com/clcrum/mongod-run2/issues
- npm.io page: https://npm.io/package/mongod-run2

## Dependencies (2)

- [temp](https://npm.io/package/temp.md) ^0.8.3
- [shelljs](https://npm.io/package/shelljs.md) ^0.7.8

## 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

- 0.1.2 (latest) — 2017-08-05
- 0.1.1 — 2017-08-05
- 0.1.0 — 2017-08-05

## README

# mongod-run2
Simplifies running mongod within MEAN / Express projects. It can also be useful when testing APIs.

This is a fork of [gtramontina/mongod-run](https://github.com/gtramontina/mongod-run) where all the real work was done. Unfortunately, there were some changes in Node 7.x that broke the original package.

## Express Example

```javascript
var mongodRun2 = require('mongod-run2');

if(!isProduction) {
  mongodRun2.start(() => {
    this.doAfterMongoStart();
  })
}
else {
  this.doAfterMongoStart();
}
```

## Testing Example

```javascript
var mongod = require('mongod-run');

before(mongod.start);
after(mongod.stop);

describe('my app', function () {
  // ...
});
```

## API
* `start(callback)`: runs mongod and call the callback once it is up and running.
* `stop()`: kills the mongod process. This is automatically called if/when the test process exits.

## Notes
The `mongod` process is being ran with the following command:
```bash
$ mongod -f --rest
```

## License
This is licensed under the feel-free-to-do-whatever-you-want-to-do license – [http://unlicense.org](http://unlicense.org)

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