You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
✅ Tested on PDF generation HTML template with Puppeteer, run in NodeJS application.
<head><!-- ...other files and HTML tags... --><!-- Load the RDKit JS file --><scriptsrc="https://unpkg.com/@rdkit/rdkit/dist/RDKit_minimal.js"></script><!-- Instantiate the WASM module. The inline script below could live elsewhere inside your application code. --><scripttype="module">constRDKitModule=awaitinitRDKitModule();// <-- Top level awaitconstsmiles="CC(=O)Oc1ccccc1C(=O)O";constmol=RDKitModule.get_mol(smiles);constsvg=mol.get_svg();console.log(svg);</script><!-- ...your application code goes here... --></head>
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'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
The text was updated successfully, but these errors were encountered: