title: How do you actually call a nested function while extending modules in nodejs?
body: <p>I basically tried extending modules with two different modules</p>
  <p>1st-</p>
  <pre><code>var exports=exports.module={};
  exports.tutorial= function(){
      console.log('Raj is king');
  };
  </code></pre>
  <p>2nd module</p>
  <pre><code>var tutor= require('./Tutorial.js');
  exports.NodeTutorial= function(){
      console.log('Node Tutorial');
      function pTutor()
      {
          var putor=tutor;
          putor.tutorial();
      }
  
  };
  </code></pre>
  <p>and finally tried to use these modules with a main.js file</p>
  <pre><code>var Addition= require('./NodeTutorial.js');
  Addition.NodeTutorial();
  Addition.NodeTutorial.pTutor();
  </code></pre>
  <p>However when I tried to execute the code i got the msg
  <code>Type Error: Addition.NodeTutorial.pTutor is not a function</code></p>