<commit_before>'use strict';

var http = require('http');
var ecstatic = require('ecstatic');
var browserify = require('browserify');
var open = require('open');
var fs = require('fs');
var exec = require('child_process').exec;

var bundleName = 'test-images-viewer-bundle.js';

fs.unlink(bundleName, function(error) {
    exec('ls ../test-images-diffs/ > list-of-incorrect-images.txt', function() {
        var b = browserify('./viewer.js', {
                    debug: true,
                    verbose: true
                });
        b.transform('brfs');
        b.bundle().pipe(fs.createWriteStream(bundleName));
    });
});

http.createServer(
    ecstatic({ root: '../.'  })
).listen(9090);

console.log('Listening on :9090');
open('http://localhost:9090/test-images-viewer');
<commit_msg>smooth test image comparison workflow:<commit_after>'use strict';

var http = require('http');
var ecstatic = require('ecstatic');
var browserify = require('browserify');
var open = require('open');
var fs = require('fs');
var exec = require('child_process').exec;

var bundleName = 'test-images-viewer-bundle.js',
    listName = 'list-of-incorrect-images.txt';

fs.unlink(bundleName, function(err) {
    exec('ls ../test-images-diffs/ > ' + listName, function() {
        var b = browserify('./viewer.js', {
                    debug: true,
                    verbose: true
                });
        b.transform('brfs');
        b.bundle().pipe(fs.createWriteStream(bundleName));

        fs.readFile(listName, 'utf8', function(err, data) {
            console.log('In ' + listName + ':\n' + data);
        });
    });
});

http.createServer(
    ecstatic({ root: '../.'  })
).listen(9090);

console.log('Listening on :9090\n');
open('http://localhost:9090/test-images-viewer');

{'fraction_non_alphanumeric': 0.18595505617977529, 'fraction_numerical': 0.014044943820224719, 'mean_word_length': 2.931567328918322, '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': '7312133', 'n_tokens_mistral': 577, 'n_tokens_neox': 551, 'n_words': 106}