-
-
Notifications
You must be signed in to change notification settings - Fork 82
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
How to use on server-side? #19
Comments
This project relies on the 2D Canvas API that is primarily found in browsers. There might be some nodejs module that implements Canvas, but I have never tried that. If you find a compatible server-side Canvas implementation, you might be able to run this code server-side. I would package it for NPM then. |
Thanks for response @ondras For now Google show me this https://github.com/Automattic/node-canvas |
It's possible and I've done this before using node-canvas and jsdom. Essentially I created a small piece of html to mimic the html page the library uses, loaded that with jsdom, then used node-canvas in place of the browsers Canvas. I was even able to stream the results from a AWS Lambda to a browser via websockets which was kind of neat since multiple people could 'watch' the generation occur in real time. Though I don't have any code to demonstrate this with unfortunately as I did it quite a while ago. |
https://gist.github.com/LoggeL/ffe3204649be0aefa178dab79b5a1a1f I've automated it with Puppeteer. Might be overkill. |
Hello. Is there an option to use this package on Node backend?
It is not available on npm, right? If so, why?
The text was updated successfully, but these errors were encountered: