title: exporting a class in Node JS
body: <p>I have written three functions as below. I have clubbed amp.js and dish.js in one package. </p>
  
  <p>amp.js:</p>
  
  <pre><code>var amp = (function() {
    //return ("This is a message from the demo package");
  
    function amp(){
        this.id=10;
    }
    amp.prototype.display=function(){  
        return 'value of id is';
    } 
  
  }());
  
  exports.amp =amp;
  </code></pre>
  
  <p>dish.js:</p>
  
  <pre><code>var cc=require('./amp');
  exports.amp=cc.amp;
  </code></pre>
  
  <p>EX.js:</p>
  
  <pre><code>var builder = require('botbuilder');
  var just=require('JUST');
  console.log(just);
  var amp= new just.amp();
  console.log(amp);
  //var ww=new builder.ConsoleConnector();
  
  // Create bot and bind to console
  var connector = new builder.ConsoleConnector().listen();
  var bot = new builder.UniversalBot(connector);
  
  bot.dialog('/', function(session){
      session.send("hello this is chat bot");
      //session.send("string returned from the %s",just.amp.display);
  });
  </code></pre>
  
  <p>Here in EX.js I am trying to access the amp.js as a class constructor, i am getting the following error,</p>
  
  <pre><code>E:\bot-prac\EX.js:4
  var amp= new just.amp();
           ^
  
  TypeError: just.amp is not a function
      at Object.&lt;anonymous&gt; (E:\bot-prac\EX.js:4:10)
      at Module._compile (module.js:409:26)
      at Object.Module._extensions..js (module.js:416:10)
      at Module.load (module.js:343:32)
      at Function.Module._load (module.js:300:12)
      at Function.Module.runMain (module.js:441:10)
      at startup (node.js:139:18)
      at node.js:974:3
  </code></pre>