<commit_before>#!/usr/bin/env node
'use strict';

var ordbok = require('./index')
  , pkg = require('./package.json')
  , query = process.argv[2]
  ;

function printHelp() {
  console.log(pkg.description);
  console.log('');
  console.log('Usage:');
  console.log('  $ ordbok <query>');
}

if (!query || process.argv.indexOf('-h') !== -1 || process.argv.indexOf('--help') !== -1) {
  printHelp();
  return;
}

if (process.argv.indexOf('-v') !== -1 || process.argv.indexOf('--version') !== -1) {
  console.log(pkg.version);
  return;
}

ordbok({word:query}, function(err, data){
  if(err) {
    throw err;
  }
  console.log(data);
});<commit_msg>Returns valid JSON<commit_after>#!/usr/bin/env node
'use strict';

var ordbok = require('./index')
  , pkg = require('./package.json')
  , query = process.argv[2]
  ;

function printHelp() {
  console.log(pkg.description);
  console.log('');
  console.log('Usage:');
  console.log('  $ ordbok <query>');
}

if (!query || process.argv.indexOf('-h') !== -1 || process.argv.indexOf('--help') !== -1) {
  printHelp();
  return;
}

if (process.argv.indexOf('-v') !== -1 || process.argv.indexOf('--version') !== -1) {
  console.log(pkg.version);
  return;
}

ordbok({word:query}, function(err, data){
  if(err) {
    throw err;
  }
  console.log(JSON.stringify(data));
});
{'fraction_non_alphanumeric': 0.2402745995423341, 'fraction_numerical': 0.007627765064836003, 'mean_word_length': 3.753623188405797, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5137577', 'n_tokens_mistral': 489, 'n_tokens_neox': 484, 'n_words': 84}