I am kind of new with node and this question has to do more with the internal working of node modules.
When we require a module, it should be loaded and run in the context of the main file that is requiring it (the one we run from the console with the node command). So all functions defined in this context (node modules that are required) should have access to all the variables in the main module due to lexical scoping rules but this is not the case. For example, a custom routing module does not have access to the app instance unless we explicitly pass it.
So are the modules executed in some isolated scope?