title: New to Node.js. Calling function from other file but node is printing whole file content
body: <p>I have two files basic.js basic1.js. Please find code below :</p>
  
  <p>basic.js : </p>
  
  <pre><code>console.log("My first node statement");
  const sum =(a,b)=&gt; a+b;
  console.log(sum(1,1));
  module.exports.sum =sum;
  </code></pre>
  
  <p>basic1.js :</p>
  
  <pre><code>const sum1= require('./basic');
  const EventE= require('events');
  const eventEmitter = new EventE();
  
  eventEmitter.on('firstEvent',(a,b)=&gt; {
    console.log(sum1.sum(a, b));
  });
  
  eventEmitter.emit('firstEvent',5,6);
  </code></pre>
  
  <p>on running basic1.js I am getting below output which seems incorrect as It should just called the function.</p>
  
  <pre><code>node basic1.js
  My first node statement
  2
  11
  </code></pre>