<commit_before># Carcass Monitor

A simple wrap of [forever-monitor](https://github.com/nodejitsu/forever-monitor), in Carcass style.

This is only meant to be used in tests where you need to start and stop some scripts easily. For production, use [forever](https://github.com/nodejitsu/forever) or equivalent.

## Quick Example

In a Mocha test:

```js
var Monitor = require('carcass-monitor');

describe('Something:', function() {
    var monitor = new Monitor();

    before(function(done) {
        /**
         * Each stack will be started with an instance of forever Monitor, in
         *   the syntax of:
         *
         * `new forever.Monitor('something', {...other_options...});`
         */
        monitor.stack({
            script: 'something',
            sourceDir: 'somewhere',
            options: ['some', 'options']
        }).stack(...).start(done);
    });

    after(function(done) {
        monitor.close(done);
    });

    ...
});
```

## APIs

### Instantiate

`var monitor = new Monitor([id])`

ID is optional; defaults to a random string.

### Add an item

`monitor.stack(options)`

Returns the monitor itself so it's chain-able. `options` is an object and will be used to instantiate a `forever.Monitor`, with `options.script` as the first argument, and the others as the second. See forever-monitor's [document](https://github.com/nodejitsu/forever-monitor#usage) for details.

Can be used multiple times to add multiple items.

### Start

`monitor.start(done)`

Starts all the items; returns the monitor itself.

### Stop

`monitor.stop(done)`

Stops all the items; returns the monitor itself.<commit_msg>Fixed readme.<commit_after># Carcass Monitor

A simple wrap of [forever-monitor](https://github.com/nodejitsu/forever-monitor), in Carcass style.

This is only meant to be used in tests where you need to start and stop some scripts easily. For production, use [forever](https://github.com/nodejitsu/forever) or equivalent.

## Quick Example

In a Mocha test:

```js
var Monitor = require('carcass-monitor');

describe('Something:', function() {
    var monitor = new Monitor();

    before(function(done) {
        /**
         * Each stack will be started with an instance of forever Monitor, in
         *   the syntax of:
         *
         * `new forever.Monitor('something', {...other_options...});`
         */
        monitor.stack({
            script: 'something',
            sourceDir: 'somewhere',
            options: ['some', 'options']
        }).stack(...).start(done);
    });

    after(function(done) {
        monitor.close(done);
    });

    ...
});
```

## APIs

### Instantiate

`var monitor = new Monitor([id])`

ID is optional; defaults to a random string.

### Add an item

`monitor.stack(options)`

Returns the monitor itself so it's chain-able. `options` is an object and will be used to instantiate a `forever.Monitor`, with `options.script` as the first argument, and the others as the second. See forever-monitor's [document](https://github.com/nodejitsu/forever-monitor#usage) for details.

Can be used multiple times to add multiple items.

### Start

`monitor.start(done)`

Starts all the items; returns the monitor itself.

### Close

`monitor.close(done)`

Closes (stops) all the items; returns the monitor itself.
{'fraction_non_alphanumeric': 0.13088369268144548, 'fraction_numerical': 0.0, 'mean_word_length': 3.0566502463054186, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4341835', 'n_tokens_mistral': 970, 'n_tokens_neox': 939, 'n_words': 331}