I have a large .js file with towards 800 variables with strings and arrays with more strings in them, which i all want to be able to access. I am currently using require('filename') to import them, but for it to work i need to have a module.exports array where i put in all the variables.
It currently works, but for me to be able to use all the variables in the file, i would have to add them all to the array.
//Main file:
const LANG = require('./Languages/Menu_' + CONFIG.language);
//File to import:
module.exports = { M, TestVar, LangAbbreviation, And800MoreVariables }
It does work, but i would have to add all 800 variables to the module.exports. which is a lot of manual labor, which i might have to do more than once as well.
Is there a way to import the variables like in without having to specify that they should be exported? Something similar to #import in C.
Sorry if i am missing some information. I am new to Javascript in general, please ask if more is needed.