title: Dynamically updating exports Nodejs
body: <p>I have this object that is being exported and imported by other files. Initially,  the object is empty but during an event change ( a button clicked), the object is filled with keys and values but still remains empty in the files that imported it. How can I dynamically update an object and then export it with it's new values.</p>
  
  <p>The code looks something like this:</p>
  
  <p><code>firstFile.js</code></p>
  
  <pre><code>const anObject = {};
  
  function clicked() {
  
   anObject.firstName = "John";
   anObject.lastName = "Doe" ;
  
  }
  
  module.exports = anObject;
  </code></pre>
  
  <p><code>secondFile.js</code></p>
  
  <pre><code>const importedObject = require("./firstFile");
  
  console.log(importedObject) // always returns an empty object
  </code></pre>