<commit_before>#!/usr/bin/env node

'use strict';

const ExifImage = require('exif').ExifImage;

var program = require('commander');

program
    .version(require('./package.json').version)
    .usage('<file ...> [options]')
    .parse(process.argv);

var files = program.args;

console.info('Number of files to check: ' + files.length);

var hasexif = false;

files.forEach(function(filePath) {
    try {
        new ExifImage({image : filePath}, function (error, exifData) {
            console.log('Checking: ' + filePath);
            if (error) {
                return console.log(`Error: ${error.message}`);
            }
            for (let key in exifData) {
                if (exifData.hasOwnProperty(key)) {
                    if (Object.keys(exifData[key]).length != 0) {
                        console.error(exifData);
                        hasexif = true;
                        break;
                    }
                }
            }
        });
    } catch (error) {
        console.log(`Error: ${error.message}`);
    }
});

process.on('exit', function() {
    if (hasexif) {
        process.exit(1);
    }
});<commit_msg>Update index.js<commit_after>#!/usr/bin/env node

'use strict';

const ExifImage = require('exif').ExifImage;

const program = require('commander');

program
    .version(require('./package.json').version)
    .usage('<file ...> [options]')
    .parse(process.argv);

const files = program.args;

console.info('Number of files to check: ' + files.length);

let hasexif = false;

files.forEach(function(filePath) {
    try {
        new ExifImage({image: filePath}, function (error, exifData) {
            console.log('Checking: ' + filePath);
            if (error) {
                return console.log(`Error: ${error.message}`);
            }
            for (const key in exifData) {
                if (exifData.hasOwnProperty(key)) {
                    if (Object.keys(exifData[key]).length != 0) {
                        console.error(exifData);
                        hasexif = true;
                        break;
                    }
                }
            }
        });
    } catch (error) {
        console.log(`Error: ${error.message}`);
    }
});

process.on('exit', function() {
    if (hasexif) {
        process.exit(1);
    }
});
{'fraction_non_alphanumeric': 0.15201385881333912, 'fraction_numerical': 0.0017323516673884798, 'mean_word_length': 1.75, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3029473', 'n_tokens_mistral': 702, 'n_tokens_neox': 687, 'n_words': 131}