mermaid-svg
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

mermaid-svg

Installation

# For npm
npm i --save mermaid-svg
# For yarn
yarn add mermaid-svg

Usage

import {generateMermaidSVG} from "mermaid-svg";
import * as fs from "fs";

(async function() {
  const mermaid = `
    graph TD
    A[Christmas] -->|Get money| B(Go shopping)
    B --> C{Let me think}
    C -->|One| D[Laptop]
    C -->|Two| E[iPhone]
    C -->|Three| F[fa:fa-car Car]
  ```;

  const svg = await generateMermaidSVG(mermaid);

  fs.writeFileSync("/diagram.svg", svg);
})();

Dependencies (2)

Dev Dependencies (8)

Package Sidebar

Install

npm i mermaid-svg

Weekly Downloads

0

Version

0.0.1

License

MIT

Unpacked Size

858 kB

Total Files

7

Last publish

Collaborators

  • wilsonzlin