title: expressJS require a file which has route object from two different place does not work
body: <p>I am working on an expressJS project. I have a route file named <code>send_email.js</code>, and I want to use parts of this file from two different places. These places are <code>index.js</code> and <code>user.js</code>. 
  So I added the following line for both of <code>index.js</code> and <code>users.js</code>:</p>
  
  <pre><code>const send_email = require("./send_mail");
  </code></pre>
  
  <p>But <code>user.js</code> is giving me an error because <code>send_email</code> is undefined. And then I just delete the same line from <code>index.js</code> and everything goes fine. I can reach send_mail in user.js, and it is what I expect.</p>
  
  <p>Am I overlooking something about requiring files in expressJS? I can use this technique effectively in other projects. Are there expressJS specific things which cause this error?</p>
  
  <p>I created same situation in another tiny project and its' codes like these:</p>
  
  <hr>
  
  <p>// ------------------------index.js -----------------------</p>
  
  <pre><code>const express = require("express");
  const app = express();
  
  /* if coment this two line every thing goes fine */
  const mylog = require("./deneme1").mylog;
  mylog();
  /* if coment this two line every thing goes fine */
  
  
  const yourlog = require("./deneme2").yourlog;
  const route = require("./deneme1").route;
  console.log('route :', route);
  
  
  yourlog();
  
  app.get("/", (req, res)=&gt;{
    res.send("OK!");
  })
  
  
  app.listen(3000, () =&gt; { "listening on "+3000});
  </code></pre>
  
  <hr>
  
  <p>// --------------deneme1.js -------------------------</p>
  
  <pre><code>const express = require("express");
  const route = express.Router();
  const yourlog = require("./deneme2").yourlog;
  console.log('yourlog mmm:', yourlog);
  
  route.get("/deneme", function(req, res){
    mylog();
    res.send("OK!");
  });
  
  function mylog () {
    console.log("mylog in deneme1.js");
  };
  
  module.exports.route = route;
  module.exports.mylog = mylog;
  </code></pre>
  
  <hr>
  
  <p>// ------------------deneme2.js-----------------</p>
  
  <pre><code>const express = require("express");
  const route = express.Router();
  
  const mylog = require("./deneme1").mylog;
  console.log('mylogxx :', mylog);
  
  function yourlog(){
    console.log("yourlog deneme2");
    mylog();
    console.log("----");
  }
  
  module.exports.yourlog = yourlog;
  </code></pre>
  
  <hr>
  
  <p><code>deneme1.js</code> and <code>deneme2.js</code> <strong>require each other</strong> and <code>express.js</code> <strong>require both of <code>deneme1.js</code> and <code>deneme2.js</code>.</strong></p>