Skip to content

Commit 16ac659

Browse files
cx1111nodkz
authored andcommitted
docs: clarify readme wording and auto-download behavior
1 parent 955a7ae commit 16ac659

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

README.md

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,47 +8,57 @@
88

99
This package spins up a actual/real MongoDB Server programmatically from node for testing or mocking during development. By default it holds the data in memory. Fresh spinned up `mongod` process takes about 7Mb of memory. The server will allow you to connect your favorite ODM or client library to the MongoDB Server and run integration tests isolated from each other.
1010

11-
This package on install downloads the latest MongoDB binaries and save it to cache folder. So first run may take a time. All further runs will fast, because use already downloaded binaries.
11+
On install, this package downloads the latest MongoDB binaries and saves it to a cache folder.
1212

13-
This package automatically downloads binaries from [https://fastdl.mongodb.org/](https://fastdl.mongodb.org/) according to your operation system. You can see all available versions by the following links [Linux](https://www.mongodb.org/dl/linux) (Ubuntu, RHEL, Debian, SUSE, Amazon), [OSX](https://www.mongodb.org/dl/osx), [Win](https://www.mongodb.org/dl/win32).
13+
On starting a new instance of the memory server, if the binary cannot be found, it will be auto-downloaded. So the first run may take some time. All further runs will be fast, because they will use the downloaded binaries.
14+
15+
This package automatically downloads binaries from [https://fastdl.mongodb.org/](https://fastdl.mongodb.org/) according to your operating system. You can see all available versions by the following links [Linux](https://www.mongodb.org/dl/linux) (Ubuntu, RHEL, Debian, SUSE, Amazon), [OSX](https://www.mongodb.org/dl/osx), [Win](https://www.mongodb.org/dl/win32).
1416

1517
Every `MongoMemoryServer` instance creates and starts fresh MongoDB server on some free port. You may start up several mongod simultaneously. When you terminate your script or call `stop()` MongoDB server(s) will be automatically shutdown.
1618

1719
Perfectly [works with Travis CI](https://github.com/nodkz/graphql-compose-mongoose/commit/7a6ac2de747d14281f9965f418065e97a57cfb37) without additional `services` and `addons` options in `.travis.yml`.
1820

1921
## Installation
2022

21-
This tool provides several packages for different purposes:
23+
This tool provides three packages for different purposes:
2224

23-
- with auto-download mongod binary on npm install (5 different ways)
24-
- without auto-download (core package)
25+
- With auto-download mongod binary on npm install
26+
- Without auto-download on npm install
2527

2628
Choose any package, because they are the same. Differs only by default configuration, which you may override (see section [Available options](#available-options)).
2729

28-
### With auto-download `latest` Mongod binary on npm install to `node_modules/.cache`
30+
### `mongodb-memory-server`
31+
32+
Auto-downloads the latest `mongod` binary on npm install to: `node_modules/.cache`.
2933

3034
```bash
3135
yarn add mongodb-memory-server --dev
3236
OR
3337
npm install mongodb-memory-server --save-dev
3438
```
3539

36-
### With auto-download `latest` Mongod binary on npm install to `%HOME/.cache`
40+
### `mongodb-memory-server-global`
41+
42+
Auto-downloads the latest `mongod` binary on npm install to: `%HOME/.cache`.
3743

3844
```bash
3945
yarn add mongodb-memory-server-global --dev
4046
OR
4147
npm install mongodb-memory-server-global --save-dev
4248
```
4349

44-
### Without auto-download
50+
### `mongodb-memory-server-core`
51+
52+
Does NOT auto-download `mongod` on npm install.
4553

4654
```bash
4755
yarn add mongodb-memory-server-core --dev
4856
OR
4957
npm install mongodb-memory-server-core --save-dev
5058
```
5159

60+
_Note: the package does try to download `mongod` upon server start if it cannot find the binary._
61+
5262
## Usage
5363

5464
### Simple server start:

0 commit comments

Comments
 (0)