exupero / saveSvgAsPng

Save SVGs as PNGs from the browser.
MIT License
1.09k stars 362 forks source link

Clean up code with ES6 #158

Closed exupero closed 6 years ago

exupero commented 6 years ago

I've updated the script to ES6 and introduced promises to clean up the code. Everything in index.html appears to be working, but that's by no means a thorough stress test. I'd appreciate some real-world testing, so if you're using saveSvgAsPng and can try the code on this branch, drop it in place of the currently published version (I've tried to keep the external interface the same) and let me know how it works out for you, especially if you encounter problems. The code is a lot cleaner and more consistent, so it should be much easier to fix bugs.

Thanks!