<commit_before># nems

![npm](https://img.shields.io/npm/v/nems.svg) ![license](https://img.shields.io/npm/l/nems.svg) ![github-issues](https://img.shields.io/github/issues/mfuhrmeister/nodejs-embedded-mongodb-standalone.svg)

nodejs-embedded-mongodb-standalone is a promise based embedded mongodb distribution library that downloads a appropriate mongodb and utilizes it as standalone, e.g. for integration/functional tests.

![nodei.co](https://nodei.co/npm/nems.png?downloads=true&downloadRank=true&stars=true)

![stars](https://img.shields.io/github/stars/mfuhrmeister/nodejs-embedded-mongodb-standalone.svg)
![forks](https://img.shields.io/github/forks/mfuhrmeister/nodejs-embedded-mongodb-standalone.svg)

CircleCI: ![Circle CI build status](https://circleci.com/gh/mfuhrmeister/nodejs-embedded-mongodb-standalone.svg?style=svg)

## Features (current)

#### Distributer
Downloads and extracts mongodb for a given version and download directory.
The version is mandatory, the download directory may default to the OS temporary directory.

###### Usage:
```javascript
var nems = require('nems');

nems.distribute('3.2.8', '.')
    .then(function (files) {
      // do anything else with the 'files' array containing File objects
    }).catch(function(err) {
      // catch any DownloadError, ExtractionError or standard Error
    });
```

## Features (comming with version 0.2.0)

#### Process<commit_msg>refactor (nems) enhance readme.md for download and extraction<commit_after># nems

![npm](https://img.shields.io/npm/v/nems.svg) ![license](https://img.shields.io/npm/l/nems.svg) ![github-issues](https://img.shields.io/github/issues/mfuhrmeister/nodejs-embedded-mongodb-standalone.svg)

nodejs-embedded-mongodb-standalone is a promise based embedded mongodb distribution library that downloads a appropriate mongodb and utilizes it as standalone, e.g. for integration/functional tests.

![nodei.co](https://nodei.co/npm/nems.png?downloads=true&downloadRank=true&stars=true)

![stars](https://img.shields.io/github/stars/mfuhrmeister/nodejs-embedded-mongodb-standalone.svg)
![forks](https://img.shields.io/github/forks/mfuhrmeister/nodejs-embedded-mongodb-standalone.svg)

CircleCI: ![Circle CI build status](https://circleci.com/gh/mfuhrmeister/nodejs-embedded-mongodb-standalone.svg?style=svg)

## Features (current)

#### Distributer
Downloads and extracts mongodb for a given version and download directory.
The version is mandatory, the download directory may default to the OS temporary directory.

###### Usage:
```javascript
var nems = require('nems');

nems.distribute('3.2.8', '.')
    .then(function (files) {
      // do anything else with the 'files' array containing File objects
    }).catch(function(err) {
      // catch any DownloadError, ExtractionError or standard Error
    });
```
You can use the download and extraction service separately:

###### Usage:
```javascript
var nems = require('nems');

nems.download('3.2.8', '.')
    .then(function (file) {
      // do anything else with the 'file' string
    }.catch(err) {
      // catch any DownloadError or standard Error
    };
    
nems.extract('/path/to/file.gz', '3.2.8', '.')
    .then(function (file) {
      // do anything else with the 'files' array containing File objects
    }.catch(err) {
      // catch any ExtractionError or standard Error
    };
```

#### Process
{'fraction_non_alphanumeric': 0.14702380952380953, 'fraction_numerical': 0.004464285714285714, 'mean_word_length': 4.473941368078176, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 14, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 18, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '274087', 'n_tokens_mistral': 1139, 'n_tokens_neox': 1050, 'n_words': 245}