<commit_before>// Modules
import { readFile, stat } from 'fs';

function getISOTime(file: string): Promise<string> {
    return new Promise((resolve, reject) => {
        stat(file, (err, time) => {
            err ? reject(err) : resolve(time.mtime.toISOString());
        });
    });
}

function readPreset(file: string): Promise<Buffer> {
    return new Promise((resolve, reject) => {
        readFile(file, (err, data) => {
            err ? reject(err) : resolve(data);
        });
    });
}

export {
    getISOTime,
    readPreset
};<commit_msg>refactor: use async/await in node utils<commit_after>// Modules
import { promises as fs } from 'fs';

async function getISOTime(file: string): Promise<string> {
    const time = await fs.stat(file);

    return time.mtime.toISOString();
}

async function readPreset(file: string): Promise<Buffer> {
    return await fs.readFile(file);
}

export {
    getISOTime,
    readPreset
};
{'fraction_non_alphanumeric': 0.14699570815450644, 'fraction_numerical': 0.0, 'mean_word_length': 3.1838565022421523, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, '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': '4513296', 'n_tokens_mistral': 295, 'n_tokens_neox': 299, 'n_words': 73}