simonhaenisch / md-to-pdf

Hackable CLI tool for converting Markdown files to PDF using Node.js and headless Chrome.
https://www.npmjs.com/md-to-pdf
MIT License
1.2k stars 110 forks source link

refactor: use browser promise #142

Closed chamabreu closed 2 years ago

chamabreu commented 2 years ago

Found a solution for the race condition.

Use the global BrowserInstance as Promise, so each call can check if there is already an launch in progress and can wait.

simonhaenisch commented 2 years ago

Closing because it's been added to #141 manually.