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.16k stars 110 forks source link

feat: use browser context #138 #139

Closed chamabreu closed 1 year ago

chamabreu commented 1 year ago

This feature uses puppeteer.BrowserContext for the convertion tasks. Now, not for each task, an own browser instance is instantiated, but only one. This one and only is used, and only browserContexts are passed down to the convertion functions. Reduces CPU Load, eliminates EventEmitter warnings and speed up conversion of large amount of files by ~50%.

chamabreu commented 1 year ago

Is Node 12 on windows-latest CI flaky??

simonhaenisch commented 1 year ago

Is Node 12 on windows-latest CI flaky??

I think Node 12 needs to be dropped anyway.

simonhaenisch commented 1 year ago

BTW I just removed you as a collaborator because I couldn't see the PRs page of this repo (would get a 500 error), and it only worked again after removing the master branch protection rules.

chamabreu commented 1 year ago

BTW I just removed you as a collaborator because I couldn't see the PRs page of this repo (would get a 500 error), and it only worked again after removing the master branch protection rules.

I got also the 500, thought it was an GitHub issue.

No Problem, I will fork it then.

simonhaenisch commented 1 year ago

Closing in favor of #141.