npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dot2mermaid

v0.1.0

Published

Convert Graphviz DOT graphs to Mermaid flowcharts for documentation and CI-generated diagrams.

Readme

dot2mermaid

Convert Graphviz DOT diagrams to Mermaid flowcharts for README files, Markdown documentation, design notes, and CI-generated docs.

Install

npm install dot2mermaid

For local development in this repository:

npm install
npm test

CLI Usage

Convert a DOT file and print Mermaid to stdout:

npx dot2mermaid ./examples/simple.dot

Write the Mermaid output to a file:

npx dot2mermaid ./examples/simple.dot -o flowchart.mmd

Choose a Mermaid flowchart direction:

npx dot2mermaid ./examples/subgraphs.dot --direction LR

When working from a clone of this repository, the same CLI is available through npm scripts:

npm run convert -- ./examples/simple.dot
npm run convert -- ./examples/simple.dot -o flowchart.mmd
npm run convert -- ./examples/subgraphs.dot --direction LR

Library Usage

import { convert } from 'dot2mermaid';

const mermaid = convert(dotSource, { direction: 'TB' });

Examples

Simple Flow

DOT input:

digraph G {
  Start -> Build
  Build -> Test [label="Unit tests"]
  Test -> Deploy
}

Mermaid output:

flowchart TB
  Start["Start"]-->Build["Build"]
  Build["Build"]-->Test["Unit tests"]
  Test["Test"]-->Deploy["Deploy"]

Files:

Subgraphs

DOT input:

digraph Release {
  subgraph cluster_prepare {
    Plan -> Build
    Build -> Test [label=CI]
  }
  subgraph cluster_publish {
    Package -> Publish
  }
  Test -> Package
}

Mermaid output with --direction LR:

flowchart LR
  Test["Test"]-->Package["Package"]

  subgraph cluster_prepare
    Plan["Plan"]-->Build["Build"]
    Build["Build"]-->Test["CI"]
  end
  subgraph cluster_publish
    Package["Package"]-->Publish["Publish"]
  end

Files:

Conversion Rules

See docs/conversion-rules.md for the supported DOT features, output shape, and current limitations.

Important behavior:

  • digraph edges using -> become Mermaid --> edges.
  • The default Mermaid direction is TB.
  • Use --direction TB|LR|RL|BT to set the generated flowchart direction.
  • Node labels are used as Mermaid node text when available.
  • DOT subgraphs are emitted as Mermaid subgraph ... end blocks.
  • Mermaid does not show a parent graph label for an unlabeled subgraph. Add a DOT label when that text must appear in rendered documentation.

Mermaid Rendering Notes

Mermaid has a default maxTextSize limit of 50,000 characters. Large DOT files may render with Maximum text size in diagram exceeded. Adjust the Mermaid configuration in the renderer when needed.

License

dot2mermaid is released under the MIT license.