Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding custom "timeout" option #189

Merged
merged 2 commits into from
Aug 1, 2023

Conversation

adasq
Copy link
Contributor

@adasq adasq commented Jan 20, 2023

The problem:

We can't set a custom timeout (Passing it through puppeteerArgs doesn't work as expected)

Solution

A new option has been added. The timeout value (default 30000 ms) is passed to:

  • puppeteer-cluster dependency (since the package has it's own timeout monitoring)
  • and to puppeteer itself (via page.setDefaultTimeout())

@adasq
Copy link
Contributor Author

adasq commented Jan 20, 2023

It closes: #179

@adasq
Copy link
Contributor Author

adasq commented Feb 8, 2023

Polite nudge @frinyvonnick :)

@salikaiperera
Copy link

The problem:

We can't set a custom timeout (Passing it through puppeteerArgs doesn't work as expected)

Solution

A new option has been added. The timeout value (default 30000 ms) is passed to:

  • puppeteer-cluster dependency (since the package has it's own timeout monitoring)
  • and to puppeteer itself (via page.setDefaultTimeout())

Any plans to release this solution soon?

@adasq
Copy link
Contributor Author

adasq commented Apr 12, 2023

This MR is released under: https://www.npmjs.com/package/nhti
I couldn't wait...

@frinyvonnick
Copy link
Owner

frinyvonnick commented Apr 12, 2023

Hi 👋 I maintain node-html-to-image on my free time. As soon as possible, I'll take care of opened pull requests but I can't give you an estimated time. I suggest to use the package from @adasq during the mean time. It would be cool to have some automated canary version so I could merge pull requests without being in the urge of publishing a new version which takes time 💡

@ariv803
Copy link

ariv803 commented Jul 27, 2023

@adasq can you provide an example of usage please?

@ariv803 ariv803 mentioned this pull request Jul 28, 2023
@adasq
Copy link
Contributor Author

adasq commented Jul 29, 2023

Hey @ariv803
It's just another option:

const nodeHtmlToImage = require('nhti') // https://www.npmjs.com/package/nhti

nodeHtmlToImage({
  output: './image.png',
  timeout: 1000 * 60 * 5, // 5 min
  html: '<html><body>Hello world!</body></html>'
})
  .then(() => console.log('The image was created successfully!'))

@frinyvonnick
Copy link
Owner

Hi @adasq 👋 I just removed some lint comments otherwise everything looks good to me, thanks 🙏

@frinyvonnick frinyvonnick merged commit 20110bc into frinyvonnick:master Aug 1, 2023
3 checks passed
@frinyvonnick
Copy link
Owner

It has been published in 3.4.0 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants