title: How to async require in nodejs
body: <p>I'm using bluebird to init various type of db connections.</p>
  
  <pre><code>// fileA.js
  Promise.all(allConnectionPromises)
      .then(function (theModels) {
          // then i want to do module.exports here
          // console.log here so the expected output
          module.exports = theModels
      })
  </code></pre>
  
  <p>So that I can require that file above from another file. however if I do that, i get <code>{}</code>.</p>
  
  <pre><code>let A = require('./fileA')  // i get {} here
  </code></pre>
  
  <p>Any idea how to do this?</p>