I have the following function :
module.exports = {
PDF_Function: function (url) {
(async () => {
console.log("Our URL => "+url);
const url = 'http://localhost:81/site/products/travel/mpdf';
const buffer = await Webpage.generatePDF(url);
return '1';
})();
}
};
How can I access the URL value from PDF_Function: function (url)
inside the async function, when I tried to console it I get the following error =>
(node:66420) UnhandledPromiseRejectionWarning: ReferenceError: Cannot access 'url' before initialization