title: Exporting the entire scope of a file in Node.js
body: <p>I made a game engine that I can use on the server side as well, and I planed to run it with Node.js.</p>
  
  <p>The engine is in its entirety packed into one file, and at the end, I export it like this:</p>
  
  <pre><code>module.exports = Irenic; //Irenic is just the name of the engine. This is actually an object housing most of the classes and functions.
  </code></pre>
  
  <p>But, what if I made some functions outside of the <code>Irenic</code> object? For example, I redefined <code>setInterval</code> and <code>setTimeout</code> functions to track how many timeouts/intervals are active, and now I relized that I wont be able to use them outside of the file the engine is in.</p>
  
  <p>How can I export everything in a file? (I already tried <code>module.exports = this;</code>, but it didn't work. Exported an empty object.)</p>
  
  <p><strong>Edit 1</strong>: I'd like to be able to simply <code>call()</code> the functions in the file I include the engine in, not do something like <code>exportedObj.call()</code>.</p>