Calling async function in main file

Since the main scope is not async, you will need to do an async anonymous function that calls your function and itself :

(async function() {
  await yourFunction();
})();

Or resolve the promise :

yourFunction().then(result => {
  // ...
}).catch(error => {
  // if you have an error
})

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)