title: Make multer upload an asyc function
body: <p>I am trying to upload image as a user is registering how do I make upload 'async'? because I need the respose of user creating i.e want to use await as follows</p>
  <pre><code>const user = await db.User.create(req.body);
  </code></pre>
  <p>the following is my code:</p>
  <pre><code>const upload = multer({ 
      storage: storage,
      fileFilter: fileFilter 
  }).single('upload'); 
  
  
  exports.user_register = async (req, res, next) =&gt; {
  try { 
      upload(req, res, (err) =&gt; {
          try {
              if (typeof req.file === 'undefined') {
                  **const user = db.User.create(req.body);**
                  const {id, username} = user;
                  res.status(201).json({id, username});               
              } else {
  
                      .
                      .
                      .
              }
  </code></pre>