Last active
June 30, 2024 15:18
-
-
Save ducan-ne/88c1f4ce047b6cf2883f3b7c0138818f to your computer and use it in GitHub Desktop.
resvg-mem-usage.js
This file has been truncated, but you can view the full file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import fs from 'node:fs/promises' | |
| import { Resvg, initWasm } from '@resvg/resvg-wasm' | |
| await initWasm(await fs.readFile(`${import.meta.dirname}/resvg.wasm`)) | |
| const resvg = new Resvg(`<svg width="1200" height="630" viewBox="0 0 1200 630" xmlns="http://www.w3.org/2000/svg"> | |
| <mask id="satori_om-id"> | |
| <rect x="0" y="0" width="1200" height="630" fill="#fff"/> | |
| </mask> | |
| <rect x="0" y="0" width="1200" height="630" fill="#fff"/> | |
| <clipPath id="satori_cp-id-0"> | |
| <rect x="0" y="0" width="1200" height="630"/> | |
| </clipPath> | |
| <mask id="satori_om-id-0"> | |
| <rect x="0" y="0" width="1200" height="630" fill="#fff"/> | |
| </mask> | |
| <image x="0" y="0" width="1200" height="630" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment