Skip to content

🎚️ A WASM-powered library for converting SVG images to WebP and JPEG formats.

License

Notifications You must be signed in to change notification settings

yurucam/svg-wasm

Repository files navigation

svg-wasm

🎚️ A WASM-powered library for converting SVG images to WebP and JPEG formats.

Install:

npm i svg-wasm

Usage:

(async () => {
  if (!SvgWasm.initialized) {
    await SvgWasm.initialize(fetch('https://unpkg.com/svg-wasm/svg_wasm_bg.wasm'));
  }

  const svg = `<svg>...</svg>`;
  
  await SvgWasm.svg2jpeg(svg); // Uint8Array
  await SvgWasm.svg2webp(svg); // Uint8Array
  await SvgWasm.svg2pixels(svg); // Uint8Array
})();

About

🎚️ A WASM-powered library for converting SVG images to WebP and JPEG formats.

Topics

Resources

License

Stars

Watchers

Forks