title: Change variable from different js
body: <p>I am new to JS and am currently attempting to make some of my own projects. For one of them, I need to have the same variable in two scripts, I am using NodeJS. For example I want...</p>
  <pre><code>var text1
  text1 = 'first text'
  //in script1.js
  </code></pre>
  <p>to change variable <code>text1</code> to <code>'first text'</code> both in script1.js and script2.js and vice versa.
  My first thought was to store <code>text1</code> in a txt document and read/write to it, but I think that this won't be so good. Any suggestions on how to do this without saving in a txt document would be appreciated. How to do it without saving in a txt, I'm looking for any solution that works.</p>