<commit_before>#htmlparser-benchmark

> Simple benchmark for diffrent htmlparsers using real-life data

## Installation

```sheel
npm install htmlparser-benchmark
```

## How to run

#### Use as a module

```javascript
var benchmark = require('htmlparser-benchmark');
var Parser = require("htmlparser2").Parser;

var bench = benchmark(function (html, callback) {
	var parser = new Parser({
		onend: callback,
		onerror: callback
	});
	parser.end(html);
});

bench.on('progress', function (key) {
	console.log('finished parsing ' + key + '.html');
});

bench.on('result', function (stat) {<commit_msg>fixed typo<commit_after>#htmlparser-benchmark

> Simple benchmark for diffrent htmlparsers using real-life data

## Installation

```shell
npm install htmlparser-benchmark
```

## How to run

#### Use as a module

```javascript
var benchmark = require('htmlparser-benchmark');
var Parser = require("htmlparser2").Parser;

var bench = benchmark(function (html, callback) {
	var parser = new Parser({
		onend: callback,
		onerror: callback
	});
	parser.end(html);
});

bench.on('progress', function (key) {
	console.log('finished parsing ' + key + '.html');
});

bench.on('result', function (stat) {
{'fraction_non_alphanumeric': 0.15204678362573099, 'fraction_numerical': 0.001670843776106934, 'mean_word_length': 5.175257731958763, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3449373', 'n_tokens_mistral': 390, 'n_tokens_neox': 369, 'n_words': 105}