title: Include JS files using function from other JS file in Node
body: <p>I have been trying this stuff a lot but I am unable to get around with this stuff.
  I have 2 JS files, add.js and console.js.</p>
  
  <p>add.js</p>
  
  <pre><code>module.exports = {
      add: function add(a,b){
          return a+b;
      }
  };
  </code></pre>
  
  <p>console.js</p>
  
  <pre><code>module.exports = {
      debug: function debug(a,b){
          console.log(add(a,b));
      }
  };
  </code></pre>
  
  <p>A part of app.js code</p>
  
  <p>app.js</p>
  
  <pre><code>var add = require('./add').add;
  var debug = require('./console');
  console.log(debug.debug(3,4));
  </code></pre>
  
  <p>This is throwing me an error in console. "add is not defined" referencing the add of console.log(add(a,b)) in console.js</p>
  
  <p>So, in general is there a way where we can write all the requires in one place (in order) and the things work automatically. For example, we do the same in javascript.</p>
  
  <pre><code>&lt;script src="add.js"/&gt;
  &lt;script src="console.js"/&gt;
  </code></pre>
  
  <p>And the thing works. But how to do the same stuff in Node JS.</p>