title: Exporting an array from a promise, but not loading when required in another file?
body: <p>I'm trying to make a request from a database and I need to combine the results of multiple columns into one array.
  I've accomplished that by making all of the requests in Promise.all() and it works. 
  However, the problem is that I need to access this data in a different file. When I require fileA in my fileB, the array appears to be empty?</p>
  
  <p>fileA.js</p>
  
  <pre><code>const days = ["monday", "tuesday", "wednesday"] 
  
  function dbRequest(day){
  
      return knexInstance.select('shift_time',`${day}`).from('shr');
  }
  
  Promise.all([
              dbRequest(days[0] ? days[0]: null),
              dbRequest(days[1] ? days[1]: null),
              dbRequest(days[2] ? days[2]: null)
  ])
  .then(results =&gt; {
      shiftR = results;
      console.log(shiftR)
      module.exports = { shiftR }; //the array only contains the dates once all the promises have been executed
  });
  </code></pre>
  
  <p>FileB.js</p>
  
  <pre><code>const shiftR = require('./fileA');
  
  console.log(shiftR);
  </code></pre>
  
  <p>I'm stumped on how to fix this. If there's a better way to accomplish what I'm trying to do then I would appreciate the suggestions.</p>
  
  <p>For context, this is what the database looks like, but I don't think this info is needed for the question.</p>
  
  <pre><code>shift_time  monday  tuesday  wednesday (...)
  6 AM        1       1        1      
  7 AM        2       2        2  
  8 AM        3       3        3  
  9 AM        3       3        3  
  </code></pre>