you can encapsulate that into a promise :
uploadId = await new Promise((resolve, reject) => {
s3Client.createMultipartUpload(initParams, function(err, res) {
if (err) {
s3Client.abortMultipartUpload();
reject();
}
uploadId = res.UploadId;
resolve(uploadId);
});
});
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…