<commit_before><!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<title>FrontConsole Demo</title>
	<link rel="stylesheet" href="demo.css">
	<link rel="stylesheet" href="../dist/frontconsole.css">
</head>
<body>
<img src="background.png" alt="">

<script src="../dist/frontconsole.js"></script>
<script>
	function process() {
		return {
			"aaa": 22,
			"ss": 4,
			"arr": ['dsada', "dsadsada", '222', {"aaa": 22, "ss": 4}]
		}
	}

	function add(args, shortFlags, longFlags) {
		if (args.length < 2) {
			throw "At least 2 arguments required";
		}
		if (shortFlags['a'] || longFlags['all']) {
			return args.reduce((total, number) => total + number);
		} else {
			return args[0] + args[1];
		}
	}

	function promiseme() {
		return new Promise((resolve) => {
			setTimeout(function () {
				resolve(['from resolved promise', "dsadsada", '222', {"aaa": 22, "ss": 4}]);
			}, 2000)
		})
	}

	function rejectme() {
		return new Promise((resolve, reject) => {
			setTimeout(function () {
				reject("from reject promise");
			}, 2000)
		})
	}

	function echo(args) {
		if (args.length) {
			return args.reduce((a, b) => `${a}; ${b}`)
		} else {
			throw "Echo needs at least one parameter"
		}
	}

	const config = {
		shortcutActivator: "ctrl",
		// shortcutKeyCode: 220,
		// convertTypes: false,
	};

	const translation = {
		"err.cmdNotFound": "Command was not found (userSetting)"
	};

	const tasks = {
		"process": {
			cmd: () => process(),
			desc: "Processes something",
		},
		"echo": {
			cmd: (args) => echo(args),
			desc: "Returns provided parameters"
		},
		"add": {
			cmd: (args, shortFlags, longFlags) => add(args, shortFlags, longFlags),
			desc: "Simply sums numbers passed as parameters"
		},
		"promiseme": {
			cmd: () => promiseme(),
			desc: "returns promise (fullfilled)"
		},
		"rejectme": {
			cmd: () => rejectme(),
			desc: "returns promise (rejected)"
		},
	};

	var fc = FrontConsole(tasks, config, translation);
	window.fc = fc;
	console.log(fc);
</script>

</body>
</html>
<commit_msg>improved example<commit_after><!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<title>FrontConsole Demo</title>
	<link rel="stylesheet" href="demo.css">
	<link rel="stylesheet" href="../dist/frontconsole.css">
</head>
<body>
<img src="background.png" alt="">

<script src="../dist/frontconsole.js"></script>
<script>
	function process() {
		return {
			"aaa": 22,
			"ss": 4,
			"arr": ['dsada', "dsadsada", '222', {"aaa": 22, "ss": 4}]
		}
	}

	function add(args, shortFlags, longFlags) {
		if (args.length < 2) {
			throw "At least 2 arguments required";
		}
		if (shortFlags['a'] || longFlags['all']) {
			return args.reduce((total, number) => total + number);
		} else if (longFlags['limit']){
			return args.slice(0, longFlags['limit']).reduce((total, number) => total + number);
		} else {
			return args[0] + args[1];
		}
	}

	function promiseme() {
		return new Promise((resolve) => {
			setTimeout(function () {
				resolve(['from resolved promise', "dsadsada", '222', {"aaa": 22, "ss": 4}]);
			}, 2000)
		})
	}

	function rejectme() {
		return new Promise((resolve, reject) => {
			setTimeout(function () {
				reject("from reject promise");
			}, 2000)
		})
	}

	function echo(args) {
		if (args.length) {
			return args.reduce((a, b) => `${a}; ${b}`)
		} else {
			throw "Echo needs at least one parameter"
		}
	}

	const config = {
		shortcutActivator: "ctrl",
		// shortcutKeyCode: 220,
		// convertTypes: false,
	};

	const translation = {
		"err.cmdNotFound": "Command was not found (userSetting)"
	};

	const tasks = {
		"process": {
			cmd: () => process(),
			desc: "Processes something",
		},
		"echo": {
			cmd: (args) => echo(args),
			desc: "Returns provided parameters"
		},
		"add": {
			cmd: (args, shortFlags, longFlags) => add(args, shortFlags, longFlags),
			desc: "Simply sums numbers passed as parameters"
		},
		"promiseme": {
			cmd: () => promiseme(),
			desc: "returns promise (fullfilled)"
		},
		"rejectme": {
			cmd: () => rejectme(),
			desc: "returns promise (rejected)"
		},
	};

	var fc = FrontConsole(tasks, config, translation);
	window.fc = fc;
	console.log(fc);
</script>

</body>
</html>

{'fraction_non_alphanumeric': 0.19981957600360847, 'fraction_numerical': 0.015110509697789806, 'mean_word_length': 3.733191035218783, 'pattern_counts': {'":': 26, '<': 43, '<?xml version=': 0, '>': 60, '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': '4688511', 'n_tokens_mistral': 1807, 'n_tokens_neox': 1562, 'n_words': 382}