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);
@@ -151,16 +151,63 @@
 erter');
+%0Aconst packageInfo = require('./package.json');
 %0A%0Aconst 
@@ -427,21 +427,23 @@
 %7D;%0A%0A
-const init = 
+// Initialize%0A(
 () =
@@ -462,17 +462,17 @@
 ole.log(
-'
+%60
 Initiali
@@ -489,17 +489,41 @@
 Currency
-'
+ v$%7BpackageInfo.version%7D%60
 );%0A    u
@@ -542,16 +542,19 @@
 ies();%0A%7D
+)()
 ;%0A%0Amodul
@@ -571,18 +571,8 @@
 = %7B%0A
-    init,%0A
     
@@ -609,50 +609,4 @@
 %0A%7D;%0A
-%0Ainit();%0A%0AsetInterval(updateCurrencies, 1000);

Make init better