title: Any reason not to bind configurations to global object in Node.js?
body: <p>I am looking for the best way to employ global configuration settings in my Node applications. In order of (my) preference the ways i have found are:</p>
  
  <ol>
  <li><p>Attach config to global object</p>
  
  <pre><code>global.config = {
      db: require('./config/db'),
      server: require('./config/server'),
      session: require('./config/session'),
      auth: require('./config/auth')
  };
  </code></pre></li>
  <li><p>Pass config object to modules that need it.</p>
  
  <pre><code>var config = {
      db: require('./config/db'),
      server: require('./config/server'),
      session: require('./config/session'),
      auth: require('./config/auth')
  };
  var responder = require('./responder')(config);
  </code></pre></li>
  <li><p>Require config files in each module. Since I usually split my config into seperate files I really do not like doing this. Since I dont always use certain files this also usually involces checking if files exist.</p></li>
  </ol>
  
  <p>Is there any reason why one should avoid either of these methods? Is there any reason why one should be preferred over the others?</p>