Open filoscoder opened 1 year ago
@filoscoder this is great, definitely we should add examples with async/await soon
@filoscoder this is great, definitely we should add examples with async/await soon
That's good to know, hope this example helps future users :)
I've been struggling to get running the javascript example on the documentation.
As it is well known, since ES2022, we can use top level await in javascript modules.
I can confirm that below example works.
✅ Tested on PDF generation HTML template with Puppeteer, run in NodeJS application.
Conclusion
After all, I got the proposed js example working. I just moved all my javascript code inside the
.then
statement.Yeap, it works, but looks very messy and decreases readability. Since most of the users are running modern browsers and my team works only with >=
ES6
, I really wanted that juicy syntactic sugar 🍭I suggest adding the above example in the docs?
what do you say @MichelML