title: How to export class instance in Node?
body: <p>Let's say, i have a class instance<br/></p>
  
  <pre><code>const User = require(./User);
  
  const id = '123456',
  secret   = '8787';
  
  const user = new User(id, secret)
  
  module.exports = user;
  </code></pre>
  
  <p>The problem is that whenever i import <code>user</code>, it just returns an empty object.<br>
  Why is this occurring and what should i do in this case?</p>
  
  <p>This is what i'm using for testing</p>
  
  <p><strong><em>index.js file</em></strong></p>
  
  <pre><code>const OAuthClient = require('disco-oauth'); //class disco-oauth
  
  const credential = require('./credential.json');
  
  //class instance
  const oauthclient = new OAuthClient(credential.id,credential.secret); 
  
  console.log(oauthclient); //Working fine in here
  
  module.exports = oauthclient; //exporting instance  
  </code></pre>
  
  <p><strong><em>test.js file</em></strong></p>
  
  <pre><code>const oauthclient = require('./index')
  console.log(oauthclient) //prints {}
  </code></pre>