<commit_before>const episodePath = document.getElementById("episode-path");

const handleEpisodeInputChange = (event) => {
    const files = event.path[0].files;
    let vlcPathPromise;

    if (files.length > 0) {
        const filePath = files[0].path;
        console.log(filePath);
    }
};

const init = () => {
    episodePath.addEventListener('change', handleEpisodeInputChange)
};

module.exports = {
    init
}<commit_msg>reading files recursively<commit_after>const readdir = require('recursive-readdir-sync');
const episodePath = document.getElementById("episode-path");

const handleEpisodeInputChange = (event) => {
    const filesInput = event.path[0].files;
    let files;

    if (filesInput.length > 0) {
        const filePath = filesInput[0].path;
        console.log(filePath);
        try {
            files = readdir(filePath);
        } catch (err) {
            if (err.errno === 34) {
                console.log('Path does not exist');
            } else {
                throw err;
            }
        }
    }

    console.log(files);
};

const init = () => {
    episodePath.addEventListener('change', handleEpisodeInputChange)
};

module.exports = {
    init
}
{'fraction_non_alphanumeric': 0.13160100586756077, 'fraction_numerical': 0.006705783738474434, 'mean_word_length': 2.564179104477612, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3608452', 'n_tokens_mistral': 362, 'n_tokens_neox': 347, 'n_words': 69}