<commit_before>const WebSocket = require('ws');

let msg = {
  name: 'channel add',
  data: {
    name: 'Some new channel'
  }
}

let ws = new WebSocket('ws://localhost:4000');

ws.onopen = () => {
  ws.send(JSON.stringify(msg))
}<commit_msg>testing channel subscription<commit_after>const WebSocket = require('ws');

let msg = {
  name: 'channel add',
  data: {
    name: 'Some new channel'
  }
}

let subMsg = {
  name: 'channel subscribe'
}

let ws = new WebSocket('ws://localhost:4000');

ws.onopen = () => {
  ws.send(JSON.stringify(subMsg))
  ws.send(JSON.stringify(msg))
}

ws.onmessage = (e) => {
  console.log(e.data);
}
{'fraction_non_alphanumeric': 0.18600953895071543, 'fraction_numerical': 0.012718600953895072, 'mean_word_length': 3.772727272727273, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '783946', 'n_tokens_mistral': 245, 'n_tokens_neox': 231, 'n_words': 49}