You need to add 'require' statements to each of the modules (scripts) that you wish to use another module's commands such like the following:-
var GlobalValues = require("GlobalValues");
Access to components within GlobalValues is then possible implementing the period notation such like:
GlobalValues.[COMPONENT TO CALL]
In addition, the module that contains re-usable items will need to 'export' their interfaces such like:
module.exports.gTiming = true;
Hope this helps?
is there any way to add a full class to the exports. say i have a class called Constants, and I want these to be available for use everywhere, do i need to add a module.exports.blah to everything?
I'm afraid so. Though the best approach here would be to configure the values as properties within an object which would mean you would only have to export the object not each value/global.
BTW, in addition to the export statement I believe the 'USEUNIT ' command carries across from JScript.
I prefer USEUNIT as it is the easiest to implement.