title: Changing same instance of variable from other file nodejs
body: <p>I'm not sure how to formulate an explanation, but I want to know how I can change a variable from the index.js file in another file. I thought by doing module.exports=(thing you want to export) then requiring the file will allow me to access the same instance of that variable, but it seems like it returns undefined. Bare in mind, I'm new to nodejs and I want to learn.</p>
  <p>in index.js:</p>
  <pre><code>const multiVerse={stuff};
  module.exports=multiVerse;
  </code></pre>
  <p>in other js file I want to use this in:</p>
  <pre><code>const main = require(./index.js)
  //change data of object
  main.multiVerse;
  </code></pre>
  <p>question: how can I access a variable from the index file in some other place in the project?</p>