<commit_before># respawn-group

Manage a group of [respawn](https://github.com/mafintosh/respawn) monitors

	npm install respawn-group

## Usage

``` js
var regroup = require('respawn-group');
var group = regroup();

group.add('test', ['node', 'server.js']);
group.start('test');
```

## API

* `regroup(defaults)` Instantiate a new respawn group. All `opts` will inherit from `defaults`

* `group.add(id, command, opts)` Add a new respawn monitor. See [respawn](https://github.com/mafintosh/respawn) for more information

* `group.remove(id, cb)` Remove a monitor

* `group.start(id)` Start a monitor

* `group.stop(id, cb)` Stop a monitor

* `group.restart(id)` Gracefully restart a monitor

## Events

* `group.on('add', mon)` New monitor has been added. `mon.id` contains the id of the monitor

* `group.on('remove', mon)` Monitor has been removed. Note that if you call `add` multiple times with the same id old monitors will be removed automatically.

* `group.on('start', mon)` Monitor has started

* `group.on('stop', mon)` Monitor is fully stopped

* `group.on('restart', mon)` Monitor is being restarted

* `group.on('spawn', mon, process)` Monitor has spawned a child process<commit_msg>restructed docs a bit<commit_after># respawn-group

Manage a group of [respawn](https://github.com/mafintosh/respawn) monitors

	npm install respawn-group

## Usage

``` js
var regroup = require('respawn-group');
var group = regroup();

group.add('test', ['node', 'server.js']);
group.start('test');
```

## API

* `regroup(defaults)` Instantiate a new respawn group. All `opts` will inherit from `defaults`

* `group.add(id, command, opts)` Add a new respawn monitor. See [respawn](https://github.com/mafintosh/respawn) for more information. Note that if you call `add` multiple times with the same `id` old monitors will be removed when they stop.

* `group.remove(id, cb)` Remove a monitor

* `group.start(id)` Start a monitor

* `group.stop(id, cb)` Stop a monitor

* `group.restart(id)` Gracefully restart a monitor

## Events

* `group.on('add', mon)` New monitor has been added. `mon.id` contains the id of the monitor

* `group.on('remove', mon)` Monitor has been removed.

* `group.on('start', mon)` Monitor has started

* `group.on('stop', mon)` Monitor is fully stopped

* `group.on('restart', mon)` Monitor is being restarted

* `group.on('spawn', mon, process)` Monitor has spawned a child process
{'fraction_non_alphanumeric': 0.14908637873754152, 'fraction_numerical': 0.0, 'mean_word_length': 4.804819277108434, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, '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': '6732002', 'n_tokens_mistral': 800, 'n_tokens_neox': 782, 'n_words': 270}