I have a module that has an index.js file and 2 different utility files with functions.
Index has:
const utl = require('./tools');
const updt = require('./update');
While both files have a version of (this is the update.js exports):
module.exports = {
updateResults,
addTeamIDsToArray,
updateTeamStats,
retrieveRankings,
numbOfWeeksToToday }
And the tools.js exports:
module.exports = {
add_weeks,
format_date,
waitForMe,
chooseWinner
}
However, when I check both constants in my index.js file, one of them is empty:
console.log(updt)
console.log(utl)
OUTPUT:
{}
{
add_weeks: [Function: add_weeks],
format_date: [Function: format_date],
waitForMe: [Function: waitForMe],
chooseWinner: [Function: chooseWinner]
}
Why is my update file not exporting correctly?
./toolsor from.(index.js)?tools.jsimports./updateor./index.