We need a simple api permitting to convert a async function to a synchronous function. Example:
async function toBlob(file) {
var r= await (new Promise(function(s,e){
var reader = new FileReader();
reader.onloadend = function(e) {
s(new Blob([ this.result ], { type: file.type } ));
};
reader.readAsArrayBuffer(file);
}))
return r;
}
sync(toBlob(file)) return directly the blob
//use blob in synchronous way