Skip to content

Latest commit

 

History

History
53 lines (41 loc) · 1.64 KB

compiler.mdx

File metadata and controls

53 lines (41 loc) · 1.64 KB

ondine/compiler

Render Mermaid to SVG in Node, build tools, and servers.

ondine/compiler loads the speed-optimized compiler module for every diagram type from the files of the package. This entrypoint uses the Node filesystem. Browsers and Workers use ondine/compiler/wasm instead.

import { render } from 'ondine/compiler'

// Compiles synchronously
const { svg } = render('flowchart LR\n  A --> B')

Functions

Errors

Namespaces

Export Contents
Render The types behind render and create: render.Options, render.ReturnType, create.Options, create.ReturnType, and RenderError.Code.
import type { Render } from 'ondine/compiler'

// Uses the options type of render for a helper
const options: Render.render.Options = { maxWidth: 640 }