title: Is a node.js module instance created for each require?
body: <p>I am trying to solve a bug in a <code>node.js</code> application.</p>
  
  <p>In a module called <code>mmm</code>, I have a local variable (not exported) called <code>xxx</code> which is set to <code>false</code>. There is an exported function called <code>enableXXX()</code> which sets the variable to <code>true</code>. Another module <code>nnn</code> requires <code>mmm</code> and calls <code>enableXXX()</code>.</p>
  
  <p>Other modules require <code>mmm</code>, but it seems that the call to <code>enableXXX()</code> has not been performed. It behaves as if <code>xxx</code> is still <code>false</code>.</p>
  
  <p>Do it mean each require create a separate instance of the module?</p>
  
  <p><strong>Update</strong></p>
  
  <p>I turns out it was a wrong upcase letter in a require:</p>
  
  <pre><code>// Module A
  var XXX = require("./myDir/xxx.js");
  ...
  
  // Module B
  var XXX = require("./mydir/xxx.js");
  ...
  </code></pre>