title: Async await in Express middleware not working
body: <p>I'm a bit of newbie to Node so be gentle. I'm creating an app for my wedding which takes an uploaded guestlist (in Excel file format) and turns it into a JSON array which I can then use to build profiles about each guest (dietary requirements, rsvp answer, etc).</p>
  
  <p>So far I've got a form on the homepage which allows the user to upload the .xlsx file and when the form is submitted the user is redirected back to the homepage again.</p>
  
  <p>I've created the following route:</p>
  
  <pre><code>router.post('/',
      guestsController.upload,
      guestsController.getGuestlist,
      guestsController.displayGuestlist
  );
  </code></pre>
  
  <p>and here's my guestsController:</p>
  
  <pre><code>const multer = require('multer');
  const convertExcel = require('excel-as-json').processFile;
  
  const storage = multer.diskStorage({ //multers disk storage settings
      destination: function (req, file, cb) {
        cb(null, './uploads/')
      },
      filename: function (req, file, cb) {
          var datetimestamp = Date.now();
          cb(null, file.fieldname + '-' + datetimestamp + '.' + file.originalname.split('.')[file.originalname.split('.').length -1])
      }
  });
  
  exports.upload = multer({storage: storage}).single('file');
  
  exports.getGuestlist = async (req, res, next) =&gt; {
  
    try {
       await convertExcel(req.file.path, null, null, (err, guestData) =&gt; {
           req.guestlist = guestData.map((guestObj) =&gt; Object.values(guestObj)[0]);
       });
       console.log(req.guestlist);
       next();
    } catch (e){
      res.json({error_code:1,err_desc:"Corrupted Excel file"});
      next();
    }
  };
  
  exports.displayGuestlist = (req, res) =&gt; {
      console.log(req.guestlist);
  };
  </code></pre>
  
  <p>At the moment because of the synchronous nature of the functions, displayGuestlist is returning undefined to the console because covertExcel has not finished grabbing the data. You can see I have tried to use the new async await syntax to resolve this but it hasn't fixed it unfortunately.</p>
  
  <p>I have also tried putting the log in displayGuestlist in a timeout function which has proven that this is purely a timing issue.</p>
  
  <p>Any helpers would be much appreciated.</p>