title: How do I update the values of this variable between modules?
body: <p>So I have module <strong>"bot.js"</strong> and in this module, it constantly checks for messages and assigns them to a variable (<em>db_users</em>). Since I run my app from <strong>"app.js"</strong>, and I pass the functions that continuously populates <em>db_users</em>, how do I get this information to <strong>"app.js"</strong>?</p>
  
  <p><strong>Bot.js</strong> is using an IRC function that stores user's messages.</p>
  
  <pre><code>var db_users = []
  // I then populate db_users with the previous data that is already in mongodb 
  // using a .find().exec() mongodb command.
  bot.addListener('message', function (from, to, text) {
      userInfo.checkForUser(db_users);
      // checkForUser basically looks through the variable db_users to see if 
      // there is a username that matches the "from" parameter in the listener
      // If it's not there, push some user information into the db_users array
      // and create a new MongoDB record.
      }
  </code></pre>
  
  <p>So I have all this, but my main app is a website that can control this "bot" (It's not a spam bot, but a moderation/statistical bot), and I'm using a require function to use <strong>"./bot.js"</strong> in <strong>"app.js"</strong></p>
  
  <p><strong>app.js</strong></p>
  
  <pre><code>bot = require('./bot');
  </code></pre>
  
  <p>So how would I constantly use the data in bot.js, in app.js? I'm a little fuzzy on how modules work.</p>
  
  <p>Yeah I could just put all of the contents of app.js in bot.js, but it would be too annoying to look through.</p>
  
  <p>Thanks!</p>