<commit_before>const request = require('request');
const cheerio = require('cheerio');
const fs = require('fs');

const CategoryDownloader = require('./lib/category_downloader');

const downloader = new CategoryDownloader(874);
downloader.downloadAllFiles();<commit_msg>Enable command line interface.<commit_after>const CategoryDownloader = require('./lib/category_downloader');

const categoryId = process.argv[process.argv.length - 1];

if (!categoryId.match(/^\d+$/)) {
  console.log('Please specify categoryId.')
  console.log('Usage: node ./index.js <categoryId>');
  process.exit(1);
}

const downloader = new CategoryDownloader(categoryId);
downloader.downloadAllFiles();
{'fraction_non_alphanumeric': 0.15191740412979352, 'fraction_numerical': 0.007374631268436578, 'mean_word_length': 6.804597701149425, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1802476', 'n_tokens_mistral': 196, 'n_tokens_neox': 191, 'n_words': 41}