import abc from ‘save-svg-as-png’; $w.onReady( async function () { //TODO: write your page related code here… var vectorSrc = ‘’; $w(‘#vectorImage1’).src = vectorSrc; var png = await abc.saveSvgAsPng(vectorSrc,“test.png”);
});
ReferenceError: document is not defined
You can see how to use any nodeJS that you have added through the Wix Package Manager here. https://support.wix.com/en/article/corvid-managing-external-code-libraries-with-the-package-manager
For more info about using save-svg-as-png itself, then you are best looking at their own documentation and info for them. https://www.npmjs.com/package/save-svg-as-png
I don’t think you will be able to use this as the api requires a document or html element which is not available on Wix.