<commit_before>Flywheel - Remote SDK for JavaScript
===
JavaScript SDK for HTML5 compliant web browsers.

# About
Given the simplicity of the protocol, you can connect to Flywheel directly over a stock HTML5 `WebSocket` - as long as you're willing to perform some trivial string manipulation to handle `B`, `P` and `R` frames, and handle socket events. This library saves you the hassle, providing -

* A convenient wrapper around the HTML5 `WebSocket` object;
* Event logging of `WebSocket` life-cycle events and message receival;
* Flywheel wire protocol - (un)marshaling of text frames and delegating to the appropriate handler;
* Connection maintenance - detecting connection failure and automatically reconnecting after a set interval.

# Limitations

* Only the text protocol is currently supported.

# Usage
The example below instantiates a remote node and opens a nexus to `ws://localhost:8080/broker`, with the reconnection option set. It then subscribes to the `time` and `communal` topics, and after binding will publishes a single `Hello world!` text message over the `communal` topic. After ten seconds of messaging activity, the remote node will permanently close the nexus.

Note: this assumes that `flywheel-remote.js` has been imported into your project.

```javascript
// configure the remote node
const conf = {
  // mandatory - the WebSocket endpoint URL
  url: "ws://localhost:8080/broker", 
  
  // optional <commit_msg>Fixed typo<commit_after>Flywheel - Remote SDK for JavaScript
===
JavaScript SDK for HTML5 compliant web browsers.

# About
Given the simplicity of the protocol, you can connect to Flywheel directly over a stock HTML5 `WebSocket` - as long as you're willing to perform some trivial string manipulation to handle `B`, `P` and `R` frames, and handle socket events. This library saves you the hassle, providing -

* A convenient wrapper around the HTML5 `WebSocket` object;
* Event logging of `WebSocket` life-cycle events and message receival;
* Flywheel wire protocol - (un)marshaling of text frames and delegating to the appropriate handler;
* Connection maintenance - detecting connection failure and automatically reconnecting after a set interval.

# Limitations

* Only the text protocol is currently supported.

# Usage
The example below instantiates a remote node and opens a nexus to `ws://localhost:8080/broker`, with the reconnection option set. It then subscribes to the `time` and `communal` topics, and after binding will publish a single `Hello world!` text message over the `communal` topic. After ten seconds of messaging activity, the remote node will permanently close the nexus.

Note: this assumes that `flywheel-remote.js` has been imported into your project.

```javascript
// configure the remote node
const conf = {
  // mandatory - the WebSocket endpoint URL
  url: "ws://localhost:8080/broker", 
  
  // optional 
{'fraction_non_alphanumeric': 0.06599513720041682, 'fraction_numerical': 0.007641542202153525, 'mean_word_length': 4.55984555984556, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '766411', 'n_tokens_mistral': 750, 'n_tokens_neox': 696, 'n_words': 385}