title: Exporting variables and functions in nodejs
body: <p>I'm trying to export a set of global variables and functions from one Javascript file to another in nodejs. </p>
  
  <p>From 
  <strong>node-js.include.js</strong></p>
  
  <pre><code>var GLOBAL_VARIABLE = 10;
  
  exports.GLOBAL_VARIABLE = GLOBAL_VARIABLE;
  
  module.exports = {
  
      add: function(a, b) {
          return a + b;
      }
  
  };
  </code></pre>
  
  <p>into <strong>test-node-js-include.js</strong>:</p>
  
  <pre><code>var includes = require('./node-js-include');
  
  process.stdout.write("We have imported a global variable with value " + includes.GLOBAL_VARIABLE);
  
  process.stdout.write("\n and added a constant value to it " + includes.add(includes.GLOBAL_VARIABLE, 10));
  </code></pre>
  
  <p>but the variable; I get the following output:</p>
  
  <pre><code>We have imported a global variable with value undefined
   and added a constant value to it NaN
  </code></pre>
  
  <p>why isn't <strong>GLOBAL_VARIABLE</strong> exported?</p>