@cf-wasm/resvg
v0.3.3
Published
A high-performance SVG renderer and toolkit, powered by Rust based resvg.
Downloads
6,625
Maintainers
Readme
@cf-wasm/resvg
A high-performance SVG renderer and toolkit, powered by Rust based resvg.
Powered by @resvg/resvg-wasm.
Installation
npm install @cf-wasm/resvg # npm
yarn add @cf-wasm/resvg # yarn
pnpm add @cf-wasm/resvg # pnpmUsage
Cloudflare Workers / Pages (Wrangler):
import { Resvg } from "@cf-wasm/resvg/workerd"; // To use v2.4.1 of @resvg/resvg-wasm, use the below instead import { Resvg } from "@cf-wasm/resvg/legacy/workerd";Next.js Edge Runtime:
import { Resvg } from "@cf-wasm/resvg/edge-light"; // To use v2.4.1 of @resvg/resvg-wasm, use the below instead import { Resvg } from "@cf-wasm/resvg/legacy/edge-light";Node.js (file base):
import { Resvg } from "@cf-wasm/resvg/node"; // To use v2.4.1 of @resvg/resvg-wasm, use the below instead import { Resvg } from "@cf-wasm/resvg/legacy/node";
Documentation
It is recommended to use Resvg.async() async static method instead of new Resvg() constructor:
import { Resvg } from "@cf-wasm/resvg/legacy/node";
// this is recommended
await Resvg.async("<svg...</svg>");
// instead of
new Resvg("<svg...</svg>");For API reference, read official documentation at @resvg/resvg-wasm.
