all the examples of using puppeter to generate pdf, official documents are written in async,await, but the node version of the project is 6.6, and async is not supported. How to change the following code to promise??
const puppeteer = require("puppeteer");
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto("http://www.baidu.com", {waitUntil: "networkidle2"});
await page.pdf({
path: "hn.pdf",
format: "A4"
});
await browser.close();
})();