title: How to manage multiple JS files server-side with Node.js
body: <p>I'm working on a project with Node.js and the server-side code is becoming large enough that I would like to split it off into multiple files.  It appears this has been done client-side for ages, development is done by inserting a <code>script</code> tag for each file and only for distribution is something like "Make" used to put everything together.  I realize there's no point in concatting all the server-side code so I'm not asking how to do that.  The closest thing I can find to use is <code>require()</code>, however it doesn't behave quite like <code>script</code> does in the browser in that require'd files do not share a common namespace.</p>
  
  <p>Looking at some older Node.js projects, like <a href="https://github.com/BonsaiDen/NodeGame-Shooter/tree/master/server" rel="noreferrer">Shooter</a>, it appears this was once not the case, that or I'm missing something really simple in my code.  My require'd files cannot access the global calling namespace at compile time nor run time.  Is there any simple way around this or are we forced to make all our require'd JS files completely autonomous from the calling scope?</p>