How to await middleware (Multer) in an Express route?

I am using Multer with a custom storage engine that ultimately uploads a file to Amazon S3. Because the file is going to Amazon S3 and then sends back some information about the file, I must await the entire Multer middleware to finish before doing anything else.

Here is an example of my Express route:

const multer  = require('multer');

  const MulterS3Storage = multerS3({
        AWSS3Client: AWSS3Client,
        Bucket: AWS_S3_BUCKETNAME,
        ACL: "public-read",
        ContentType: "video/mp4",
        Key: "123456789"           // This is a random string
    });

    const upload = multer({
        storage:  MulterS3Storage, // This is a custom storage engine which works
    });
    
    app.post('/form', upload.single('uploaded_file'), function (req, res) {
        console.log('I MUST wait for upload.single to finish');
         Result = {
                  code: 200,
                  files: req.file, // from Multer with metadata in it about the file e.g. file.location
                  }
         return res.status(Result.code).json(Result); // this runs before Multer has returned the callback
        });

Unfortunately it is not waiting for the upload.single to complete. That is, the route executes the console.log and returns the res.status BEFORE MulterS3Upload has run the callback with the correct information in req.file.

In my mind it seems I need to await the upload.single(uploaded_file) part but not sure how to do that?

This is what multerS3 does:

function AWSS3Storage(opts) {
    this.AWSS3Client = opts.AWSS3Client;
    this.Bucket = opts.Bucket;
    this.getKey = opts.Key;
    this.getContentType = opts.ContentType;
    this.ACL = opts.ACL;
    this.ServerSideEncryption = opts.serverSideEncryption;
    this.Metadata = opts.metadata;


}

AWSS3Storage.prototype._handleFile = async function _handleFile(req, file, cb) {
    const that = this;

            let Key =  that.getKey;
            let ContentType = that.getContentType;
            const FileStream = file.stream
            //console.log(`file.stream`, FileStream)
            console.log(`multer-s3-storage-engine.js key:`, Key)
            try {
                const Response = await s3Upload({
                    AWSS3Client: that.AWSS3Client,
                    Bucket: that.Bucket,
                    ACL: that.ACL,
                    ContentType: ContentType,
                    Key: Key,
                    Body: FileStream
                });

console.log(`middleware needs to wait until this callback below is returned: filename: ${path.parse(Key).base}, location ${Response.Location}`)

                cb(null, {
                    filename: path.parse(Key).base, 
                    location: Response.Location
                });

            } catch (e) {
                console.log(e);
            }

};

AWSS3Storage.prototype._removeFile = async function _removeFile(req, file, cb) {
const S3Command = new DeleteObjectCommand({Bucket: file.Bucket, Key: file.Key})
await this.AWSS3Client.send(S3Command);
cb();

}

export default async function (opts) {
    return new AWSS3Storage(opts);
}