@mermanjs/web-analysis
v0.10.0
Published
Browser-only Merman WebAssembly SDK for semantic analysis and detection.
Maintainers
Readme
@mermanjs/web-analysis
Detect, validate, and analyze Mermaid source in a browser without shipping SVG rendering, ASCII output, or retained editor sessions.
Version 0.10.0 uses Web transport API 10, facts schema 3, and Options JSON schema 3. Keep the facade, generated glue, and WASM at the same exact version and source revision. Check the host installation guide for verified versions and channel availability.
Published 0.10.0-alpha.2 retains Web transport API 9. Version 0.10.0-alpha.1 retains Web transport API 8, facts schema 2, and Options JSON schema 3. Upgrade all package assets together and update facts consumers for the source appearance changes.
Quick start
npm install --save-exact @mermanjs/[email protected]import { analyzeDocument, initMerman } from "@mermanjs/web-analysis";
await initMerman();
const markdownSource =
"# Diagram\n\n```mermaid\nflowchart TD\n A -->\n```\n";
const result = analyzeDocument(
markdownSource,
"file:///workspace/README.md",
{ lint: { profile: "recommended" } },
);
if (!result.valid) {
console.error(result.diagnostics);
}The URI extension selects standalone Mermaid, Markdown, or MDX modeling. Diagnostics and fixes use host-document coordinates.
Scope
Use this package for browser linting, detection, and metadata workflows. It intentionally cannot
render SVG or ASCII and cannot create editor sessions. Load it only in a browser main thread or Web
Worker. Node.js and SSR analysis integrations should use merman-cli; use @mermanjs/node only
for in-process SVG rendering.
See the browser package guide for custom WASM loading, resource policy, package selection, and source-checkout development. See the integration guide for lint ownership and adapter boundaries, and the current changelog for changes and upgrade actions.
