@mermanjs/web
v0.9.2
Published
Browser-only Merman WebAssembly SDK with the complete admitted browser capability set.
Maintainers
Readme
@mermanjs/web
The complete browser SDK for SVG rendering, analysis, ASCII output, and parser-backed editor intelligence. Start here when evaluating Merman or when one browser realm needs more than one workflow.
Pin an exact package version when reproducible installs matter.
Quick start
npm install @mermanjs/[email protected]import { initMerman, renderSvgToElement } from "@mermanjs/web";
await initMerman();
const target = document.querySelector("#diagram");
if (!target) throw new Error("missing #diagram mount point");
renderSvgToElement(target, `flowchart TD
A[Start] --> B[Done]`);Use renderSvg() when the host needs the serialized SVG string instead of a mounted element.
Runtime boundary
Load this package only in a browser main thread or Web Worker. It is not a Node.js or SSR transport;
use @mermanjs/node
for supported native Node.js hosts.
Initialize Merman once per realm and reuse it. A host that creates a Worker owns Worker termination. Dispose retained editor and text-measurement sessions when they are no longer needed.
See the browser package guide for package selection, safe DOM mounting, custom WASM loading, resource limits, and source-checkout development.
