<commit_before>/*
	MIT License http://www.opensource.org/licenses/mit-license.php
	Author <NAME> @sokra
*/
var sprintf = require("sprintf").sprintf;
var createFilenameShortener = require("./createFilenameShortener");
var path = require("path");
module.exports = function(stats, options) {
	var buf = [];

	function c(str) {
		return options.colors ? str : "";
	}

	buf.push("Hash: "+c("\033[1m") + stats.hash + c("\033[22m"));
	buf.push("Compile Time: "+c("\033[1m") + Math.round(stats.time) + "ms" + c("\033[22m"));
	buf.push("Chunks: "+c("\033[1m") + stats.chunkCount + c("\033[22m"));
	buf.push("Modules: "+c("\033[1m") + stats.modulesCount + c("\033[22m"));
	buf.push("Modules including duplicates: "+c("\033[1m") + stats.modulesIncludingDuplicates + c("\033[22m"));
	buf.push("Modules first chunk: "+c("\033[1m") + stats.modulesFirstChunk + c("\033[22m"));
	if(stats.fileSizes) {
		var maxLenFilename = 0;
		var maxLenChunkname = 0;
		Object.keys(stats.fileSizes).forEach(function(file) {
			if(file.length > maxLenFilename) maxLenFilename = file.length;
		});
		var fileChunkNames = {};
		Object.keys(stats.chunkNameFiles).forEach(function(name) {
			if(/^[1-9][0-9]*$/.test(name)) return;
			var filename = stats.chunkNameFiles[name];
			if(!fileChunkNames[filename])
				fileChunkNames[filename] = [];
			fileChunkNames[filename].push(name);
			var length = fileChunkNames[filename].join(" ").length;
			if(length > maxLenChunkname) maxLenChunkname = length;
		});
		Object.keys(stats.fileSizes).forEach(function(file) {
			var name = fileChunkNames[file] && fileChunkNames[file].join(" ") || "";
			var fileLine = sprintf("%" + maxLenChunkname + "s", name) + c("\033[1m") + sprintf("%" + (3 + maxLenFilename) + "s", file) + c("\033[22m")+": "+c("\033[1m") + sprintf("%8d", stats.fileSizes[file]) + c("\033[22m") + " chars/bytes ";
			buf.push(fileLine);
		});
	}<commit_msg>remove annoying space<commit_after>/*
	MIT License http://www.opensource.org/licenses/mit-license.php
	Author <NAME> @sokra
*/
var sprintf = require("sprintf").sprintf;
var createFilenameShortener = require("./createFilenameShortener");
var path = require("path");
module.exports = function(stats, options) {
	var buf = [];

	function c(str) {
		return options.colors ? str : "";
	}

	buf.push("Hash: "+c("\033[1m") + stats.hash + c("\033[22m"));
	buf.push("Compile Time: "+c("\033[1m") + Math.round(stats.time) + "ms" + c("\033[22m"));
	buf.push("Chunks: "+c("\033[1m") + stats.chunkCount + c("\033[22m"));
	buf.push("Modules: "+c("\033[1m") + stats.modulesCount + c("\033[22m"));
	buf.push("Modules including duplicates: "+c("\033[1m") + stats.modulesIncludingDuplicates + c("\033[22m"));
	buf.push("Modules first chunk: "+c("\033[1m") + stats.modulesFirstChunk + c("\033[22m"));
	if(stats.fileSizes) {
		var maxLenFilename = 0;
		var maxLenChunkname = 0;
		Object.keys(stats.fileSizes).forEach(function(file) {
			if(file.length > maxLenFilename) maxLenFilename = file.length;
		});
		var fileChunkNames = {};
		Object.keys(stats.chunkNameFiles).forEach(function(name) {
			if(/^[1-9][0-9]*$/.test(name)) return;
			var filename = stats.chunkNameFiles[name];
			if(!fileChunkNames[filename])
				fileChunkNames[filename] = [];
			fileChunkNames[filename].push(name);
			var length = fileChunkNames[filename].join(" ").length;
			if(length > maxLenChunkname) maxLenChunkname = length;
		});
		Object.keys(stats.fileSizes).forEach(function(file) {
			var name = fileChunkNames[file] && fileChunkNames[file].join(" ") || "";
			var fileLine = sprintf("%" + maxLenChunkname + "s", name) + c("\033[1m") + sprintf("%" + (3 + maxLenFilename) + "s", file) + c("\033[22m")+": "+c("\033[1m") + sprintf("%8d", stats.fileSizes[file]) + c("\033[22m") + " chars/bytes";
			buf.push(fileLine);
		});
	}
{'fraction_non_alphanumeric': 0.21574344023323616, 'fraction_numerical': 0.042406573018817915, 'mean_word_length': 5.009554140127388, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6094975', 'n_tokens_mistral': 1475, 'n_tokens_neox': 1333, 'n_words': 224}