I know that global variables are bad.
But if I am using node\'s module \"util\" in 40 files in my framework, isn\'t it better to just declare it as a global variable
global.util = require('util');
There's a section about global objects in the node documentation.
However, globals should be used with care. By adding modules to the global space you reduce testability and encapsulation. But there are cases where using this method is acceptable. For example, I add functions and objects to the global namespace to use within my unit test scripts.