1.0.3 • Published 10 months ago

node-mermaid-render v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

node-mermaid-render

Render Mermaid charts in Node.js environment.

Also can be seen as a simplified version of mermaid-cli with better API support.

Most of its core code is from mermaid-cli.

Install

npm install node-mermaid-render

Usage

import { NodeMermaidRender } from "node-mermaid-render";

const mermaidRender = new NodeMermaidRender();

(async () => {
  // Initialize mermaid render.
  // If don't call this method, it will be called automatically when calling rendering method.
  // Remember to call it with `await` keyword.
  await mermaidRender.initialize();

  const svg = await mermaidRender.renderToSVG(`
    graph TD;
      A-->B;
      A-->C;
      B-->D;
      C-->D;
  `).data.toString();
})();
1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago