<commit_before>module.exports = function analyze() {
  console.log('analyzing...');
};<commit_msg>Connect CLI tool to Analyzer<commit_after>'use strict';

const path = require('path');
const Analyzer = require('hekla-core').Analyzer;

module.exports = function analyze() {
  let config;

  try {
    config = require(getHeklafilePath());
  } catch (err) {
    console.error('Configuration error:', err.stack);
    process.exit(1);
  }

  const analyzer = new Analyzer(config);
  analyzer.run();
};

function getHeklafilePath() {
  return path.resolve(process.cwd(), 'Heklafile.js');
}
{'fraction_non_alphanumeric': 0.16267123287671234, 'fraction_numerical': 0.0017123287671232876, 'mean_word_length': 4.679611650485437, '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': '5552253', 'n_tokens_mistral': 195, 'n_tokens_neox': 187, 'n_words': 40}