<commit_before>const { getFeed } = require('./lib/ecb-connect');
const { parseXML } = require('./lib/parser');
const { setCurrencies, convert } = require('./lib/converter');

const updateCurrencies = () => {
    getFeed()
        .then(parseXML)
        .then((result) => {
            setCurrencies(result);
        })
        .catch((error) => {
            console.error(error);
        });
};

const init = () => {
    console.log('Initializing RapidCurrency');
    updateCurrencies();
};

module.exports = {
    init,
    convert,
    updateCurrencies,
};

init();

setInterval(updateCurrencies, 1000);<commit_msg>Make init better<commit_after>const { getFeed } = require('./lib/ecb-connect');
const { parseXML } = require('./lib/parser');
const { setCurrencies, convert } = require('./lib/converter');
const packageInfo = require('./package.json');

const updateCurrencies = () => {
    getFeed()
        .then(parseXML)
        .then((result) => {
            setCurrencies(result);
        })
        .catch((error) => {
            console.error(error);
        });
};

// Initialize
(() => {
    console.log(`Initializing RapidCurrency v${packageInfo.version}`);
    updateCurrencies();
})();

module.exports = {
    convert,
    updateCurrencies,
};

{'fraction_non_alphanumeric': 0.18080888183980967, 'fraction_numerical': 0.0031720856463124504, 'mean_word_length': 2.755952380952381, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4948142', 'n_tokens_mistral': 387, 'n_tokens_neox': 372, 'n_words': 60}