<commit_before># Quick Start
Process A:

```js
var EventEmitter = require('distributed-eventemitter');
var events = new EventEmitter(); // host: localhost, port: 61613
events.connect().then(()=> {
  events.on('email.send', (message, resolve, reject) => {
    //... send email
    // ...

    resolve('sent');
  });
});
```

Process A (copy):

```js
//...
events.on('email.send', (message, resolve, reject) => {
  //... send email
  // ...

  resolve('sent');
});
```

Process B:

```js
//...
events.emitToOne('email.send' {
  to: '<EMAIL>',
  subject: 'Hello Node.js',
  body: 'Introducing easy distributed messaging for Node.js...'
}).then((response) => {
  if ('sent' === response){
    // ...
  }
})
```

# Requirements
- Running [STOMP compliant broker](http://activemq.apache.org/installation.html) instance. Default client destinations are:
  1. _/topic/distributed-eventemitter_: Used for events broadcast (emit)
  - _/queue/distributed-eventemitter_: Used for one-to-one events (request)

    > If the broker require clients to be authenticated, you can use:

  ```js
  config.headers = {
    login: 'user',
    passcode: 'password'
  };
  ```

  > A temporary queue per client is used as a reply-to channel.

# Installation

```bash
$ npm install distributed-eventemitter
```

# Features
- Extends [eventemitter2](https://www.npmjs.com/package/eventemitter2/).
- Promise based API.
- One-To-One based communication intended for service clusters (emitToOne). One-To-Many for normal events broadcast (the classic 'emit')
- Works with any STOMP compliant message broker (ie. ActiveMQ, RabbitMQ,  ...).
- Uses [stompjs](https://www.npmjs.com/package/stompjs/) as STOMP client.

# Config params<commit_msg>doc fixing.<commit_after># Quick Start
Process A:

```js
var EventEmitter = require('distributed-eventemitter');
var events = new EventEmitter(); // host: localhost, port: 61613
events.connect().then(()=> {
  events.on('email.send', (message, resolve, reject) => {
    //... send email
    // ...

    resolve('sent');
  });
});
```

Process A (copy):

```js
//...
events.on('email.send', (message, resolve, reject) => {
  //... send email
  // ...

  resolve('sent');
});
```

Process B:

```js
//...
events.emitToOne('email.send' {
  to: '<EMAIL>',
  subject: 'Hello Node.js',
  body: 'Introducing easy distributed messaging for Node.js...'
}).then((response) => {
  if ('sent' === response){
    // ...
  }
})
```

# Requirements
- Running [STOMP compliant broker](http://activemq.apache.org/installation.html) instance. Default client destinations are:
  1. _/topic/distributed-eventemitter_: Used for events broadcast (emit)
  - _/queue/distributed-eventemitter_: Used for one-to-one events (emitToOne)

    > If the broker require clients to be authenticated, you can use:

  ```js
  config.headers = {
    login: 'user',
    passcode: 'password'
  };
  ```

  > A temporary queue per client is used as a reply-to channel.

# Installation

```bash
$ npm install distributed-eventemitter
```

# Features
- Extends [eventemitter2](https://www.npmjs.com/package/eventemitter2/).
- Promise based API.
- One-To-One based communication intended for service clusters (emitToOne). One-To-Many for normal events broadcast (the classic 'emit')
- Works with any STOMP compliant message broker (ie. ActiveMQ, RabbitMQ,  ...).
- Uses [stompjs](https://www.npmjs.com/package/stompjs/) as STOMP client.

# Config params
{'fraction_non_alphanumeric': 0.17280701754385966, 'fraction_numerical': 0.004678362573099415, 'mean_word_length': 3.437094682230869, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, 'https://': 4, 'lorem ipsum': 0, 'www.': 4, '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': '1282736', 'n_tokens_mistral': 1140, 'n_tokens_neox': 1059, 'n_words': 302}