Heya, this isn't strictly a discord.js question, but I'm having a hard time finding a good answer searching the internet.
My bot uses a mysql connection to create and manage its database, but for readability I've sectioned out my sql functions into their own scripts. The issue I'm currently running into is that the 'sql' global variable I pass to those scripts using module.exports isn't initialized during compile time, so I get the error that 'sql.query()' cannot be read because it isn't a property of 'undefined'. I'd prefer not having to constantly pass 'sql' as a parameter into every method call if possible, but I'm not finding a good solution to assure js that the property will be defined during runtime