const AWS = require('aws-sdk')

// configure AWS to log to stdout
AWS.config.update({
    logger: process.stdout
})

module.exports = function (stream, config, key) {
    const s3 = new AWS.S3({
        region: config.S3_REGION
    })
    return s3.upload({
        Key: key,
        Bucket: config.S3_BUCKET,
        Body: stream
    }).promise()
        .then((result) => {
            console.log('Uploaded to', result.Location)
            return result.Location
        })
}

@@ -114,24 +114,13 @@
 %7D)%0A%0A
-module.exports =
+async
  fun
@@ -125,16 +125,24 @@
 unction 
+uploadS3
 (stream,
@@ -229,22 +229,36 @@
  %7D)%0A    
-return
+const result = await
  s3.uplo
@@ -356,44 +356,9 @@
 e()%0A
-        .then((result) =%3E %7B%0A        
+%0A
     
@@ -401,24 +401,16 @@
 cation)%0A
-        
     retu
@@ -432,17 +432,33 @@
 ion%0A
-        %7D)%0A%7D
+%7D%0A%0Amodule.exports = uploadS3
 %0A

use a named function for uploadS3