creating a global object in nodejs accessible by .js modules
<p>My nodejs project requires memory tables accessible by different .js module. Some modules will update the tables but the data must be the same across all modules(sort of a in memory db). As such, I need a truly global object....not a global per module object. Creating a <strong>common.js</strong> file with all the objects then <strong>require</strong> it in all the modules will not do since the data will be global/local to the respective modules. I have seen reference to <strong>nodejs globals</strong> where <strong>global.myobject</strong> would be global to all modules but the documentation is not clear as to whether this is so or not. The last discussion I saw was from 2014. Can anyone update me on what is the current situation? How is this problem solved? </p>