title: module.exports gets undefined while importing on another file
body: <p>This is my file structure for simple Express app.</p>
  
  <pre><code>server/
    |- models
    |--- users.js
    |- index.js
  </code></pre>
  
  <p><code>index.js</code> is the entry point</p>
  
  <pre><code>const app = require('express')();
  const Server = require('http').createServer(app)
  const io = require('socket.io')(Server);
  ......
  .....
  .....
  .....
  ....
  module.exports = {
      Server,
      io
  }
  </code></pre>
  
  <p>inside my <code>models/users.js</code> I need the <code>io</code> variable exported above just to emit some event to all connected clients if new user is added. for this I imported </p>
  
  <pre><code>const { io } = require('../index');
  </code></pre>
  
  <p>but <code>io</code> is <code>undefined</code>.
  I have tried few other similar ways</p>
  
  <pre><code>const io = require('../index').io // 
  </code></pre>
  
  <p>and</p>
  
  <pre><code>const io = require('../').io /index is useless on require
  </code></pre>
  
  <p>but none worked.
  Am I being silly or did I miss something here.
  any help would be highly appreciated.</p>
  
  <p>Thanks</p>