<commit_before>'use strict';
var CliTable = require('cli-table');
var fillArray = require('fill-array');
var objectAssign = require('object-assign');
var objectValues = require('object-values');
var windowSize = require('window-size');

module.exports = function (arr, opts) {
	arr = Array.isArray(arr) ? arr : [arr];

	var keys = [];
	var vals = [];

	for (var i = 0; i < arr.length; i++) {
		vals.push(objectValues(arr[i]));

		for (var key in arr[i]) {
			if (keys.indexOf(key) === -1) {
				keys.push(key);
			}
		}
	}

	var width = Math.floor(windowSize.width / (keys.length + 4));
	var table = new CliTable(objectAssign({
		head: keys,
		colWidths: fillArray([width], keys.length)
	}, opts));

	for (var j = 0; j < vals.length; j++) {
		table.push(vals[j]);
	}

	return table;
};<commit_msg>Adjust default width<commit_after>'use strict';
var CliTable = require('cli-table');
var fillArray = require('fill-array');
var objectAssign = require('object-assign');
var objectValues = require('object-values');
var windowSize = require('window-size');

module.exports = function (arr, opts) {
	arr = Array.isArray(arr) ? arr : [arr];

	var keys = [];
	var vals = [];

	for (var i = 0; i < arr.length; i++) {
		vals.push(objectValues(arr[i]));

		for (var key in arr[i]) {
			if (keys.indexOf(key) === -1) {
				keys.push(key);
			}
		}
	}

	var width = Math.floor(windowSize.width / (keys.length + 1));
	var table = new CliTable(objectAssign({
		head: keys,
		colWidths: fillArray([width], keys.length)
	}, opts));

	for (var j = 0; j < vals.length; j++) {
		table.push(vals[j]);
	}

	return table;
};
{'fraction_non_alphanumeric': 0.19113054341036853, 'fraction_numerical': 0.004996876951905059, 'mean_word_length': 3.8990825688073394, 'pattern_counts': {'":': 0, '<': 7, '<?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': '3149436', 'n_tokens_mistral': 613, 'n_tokens_neox': 566, 'n_words': 144}