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

var argv = require('minimist')(process.argv.slice(2));
var command = argv._[0];
var testCase = argv._[1];
var revision = argv._[2].toString();
var run = require('../lib/run');
var JsPerf = require('../lib/jsperf');
var fs = require('fs');

function printUsage() {
  console.log();
}

switch (command) {
  case 'init':
    fs.writeFileSync('./package.json', `
      {
        "name": "jsperf.com",
        "version": "0.1.0",
        "private": true,
        "description": "Run jsperf.com tests locally with your NodeJS version",
        "dependencies": {
        },
        "devDependencies": {
        }
      }
    `);
    run('npm install benchmark beautify-benchmark --save-dev');
    break;
  case 'get':
    var jsPerf = new JsPerf(testCase, revision);
    jsPerf
      .get()
      .then(() => console.log(`Test case ${testCase}v${revision} installed`))
      .catch(err => console.error(`Failed to install test case ${testCase}v${revision}`, err));
    break;
  case 'run':
    var jsPerf = new JsPerf(testCase, revision);
    jsPerf.run();
    break;
  case 'preview':
    var jsPerf = new JsPerf(testCase, revision);
    console.log(jsPerf.getTestSource());
    break;
  default:
    printUsage();
}<commit_msg>Quick fix<commit_after>#!/usr/bin/env node

var argv = require('minimist')(process.argv.slice(2));
var command = argv._[0];
var testCase = argv._[1];
var revision = argv._[2];
var run = require('../lib/run');
var JsPerf = require('../lib/jsperf');
var fs = require('fs');

function printUsage() {
  console.log();
}

switch (command) {
  case 'init':
    fs.writeFileSync('./package.json', `
      {
        "name": "jsperf.com",
        "version": "0.1.0",
        "private": true,
        "description": "Run jsperf.com tests locally with your NodeJS version",
        "dependencies": {
        },
        "devDependencies": {
        }
      }
    `);
    run('npm install benchmark beautify-benchmark --save-dev');
    break;
  case 'get':
    var jsPerf = new JsPerf(testCase, revision.toString());
    jsPerf
      .get()
      .then(() => console.log(`Test case ${testCase}v${revision} installed`))
      .catch(err => console.error(`Failed to install test case ${testCase}v${revision}`, err));
    break;
  case 'run':
    var jsPerf = new JsPerf(testCase, revision.toString());
    jsPerf.run();
    break;
  case 'preview':
    var jsPerf = new JsPerf(testCase, revision.toString());
    console.log(jsPerf.getTestSource());
    break;
  default:
    printUsage();
}
{'fraction_non_alphanumeric': 0.17679558011049723, 'fraction_numerical': 0.0055248618784530384, 'mean_word_length': 2.9, 'pattern_counts': {'":': 12, '<': 3, '<?xml version=': 0, '>': 7, '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': '5848503', 'n_tokens_mistral': 854, 'n_tokens_neox': 842, 'n_words': 195}