html-to-image icon indicating copy to clipboard operation
html-to-image copied to clipboard

NodeJS support?

Open webhype opened this issue 3 years ago • 3 comments

Hi, is NodeJS support planned or is there a workaround to run this under NodeJS without loading a whole Chromium with it? There are a few Puppeteer/Chromium based libraries out there but they are rather heavyweight and the Chromium has to be compatible with the target OS. Thanks!

webhype avatar Nov 26 '22 01:11 webhype

👋 @webhype

Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. To help make it easier for us to investigate your issue, please follow the contributing guidelines.

We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

biiibooo[bot] avatar Nov 26 '22 01:11 biiibooo[bot]

This would be cool and very useful, though I don't know how heavy it would be.

I tried running this with a jsdom node, but it didn't work: this library expects certain browser objects, such as HTMLCanvasElement, to be in global scope. I'm pretty sure jsdom implements those objects to some degree, but I'm not sure how complete they are, or how to bridge the gap so html-to-image can find them. Would be interesting to try though.

saltire avatar Feb 24 '23 18:02 saltire