Im currently working on opening and writing on an excel file using exceljs. However, the await is making an error
SyntaxError: await is only valid in async functions and the top level bodies of modules
Despite the function being in async. How can I resolve this problem? The following is the code that I am using
async function Process(filename){
  const workbook = new ExcelJS.Workbook();
  let myPromise = new Promise(function(myResolve, myReject) {
    // "Producing Code" (May take some time)
    try{
      await workbook.xlsx.readFile(filename)
      myResolve(); // when successful
    }catch(err){
      myReject();  // when error
    }
  });
  // "Consuming Code" (Must wait for a fulfilled Promise)
  myPromise.then(
    function() {
        /* code if successful */ 
    },
    function() {return false;}
  );
}
 
    