<commit_before>#! /usr/bin/env node

const path = require('path');
const fs = require('fs');

const program = require('commander');

const pkg = require('../package.json');
const server = require('../lib/server.js');

function failWithHelp(msg) {
  console.log(msg);
  program.help();
  process.exit(1);
}

program
  .version(pkg.version)
  .arguments('<dir>')
  .option('-p, --port <port>', 'the port to run the server off of. defaults to 8080.', 8080)
  .action(dir => {
    const fullPath = path.resolve(dir);

    if (fs.existsSync(fullPath)) {
      server(fullPath, program.port);
    } else {
      failWithHelp(`Could not find a directory at ${fullPath}`)
    }
  });

program.parse(process.argv);

if (!program.args[0])<commit_msg>Make note of the need to change the plugin's port when changing the server's<commit_after>#! /usr/bin/env node

const path = require('path');
const fs = require('fs');

const program = require('commander');

const pkg = require('../package.json');
const server = require('../lib/server.js');

function failWithHelp(msg) {
  console.log(msg);
  program.help();
  process.exit(1);
}

program
  .version(pkg.version)
  .arguments('<dir>')
  .option('-p, --port <port>', 'the port to run the server off of. defaults ' +
    'to 8080. you also need to change the port that the plugin uses.', 8080)
  .action(dir => {
    const fullPath = path.resolve(dir);

    if (fs.existsSync(fullPath)) {
      server(fullPath, program.port);
    } else {
      failWithHelp(`Could not find a directory at ${fullPath}`)
    }
  });

program.parse(process.argv);

if (!program.args[0])
{'fraction_non_alphanumeric': 0.1729931549471064, 'fraction_numerical': 0.012445550715619166, 'mean_word_length': 3.647398843930636, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '1047690', 'n_tokens_mistral': 543, 'n_tokens_neox': 526, 'n_words': 143}