I understand how exports works, but how can I create a variable in my main file, and then use that variable in my module? I tried passing my "global" variable to a function in my module, but it passed as a copy, not by reference and since its an array I'm passing that's no good.
For example
# main file
var someObject = {};
var myModule = require('./whatever');
moModule.function_a(someObject);
moModule.function_b(someObject);
Even though someObject is an object it passes by copying, and if I change its value inside function_a or function_b, it wont change in the global scope, or in any other modules where I use it.