mermaid-formatter weekly downloads statistics
By chenyanchen · npm · Prettier plugins
A formatter for Mermaid diagram syntax
mermaid-formatter has 144 recorded weekly downloads on npm, a decrease of 85.2% over the past 30 days.
It ranks #1629 of 2,251 tracked npm listings by weekly downloads.
Over 90 days, weekly downloads changed by -49.1%.
PluginStats has 121 daily observations since Jun 19, 2026; the latest is from Oct 17, 2026.
About mermaid-formatter
mermaid-formatter
A formatter for Mermaid diagram syntax.
Features
• Format all Mermaid diagram types (sequenceDiagram, flowchart, classDiagram, etc.) • Normalize indentation and whitespace • Format Mermaid code blocks in Markdown • CLI tool and programmatic API • Zero dependencies (lightweight)
Installation
Usage
CLI
Prettier Plugin
Programmatic API
API Reference
formatMermaid(input: string, options?: FormatOptions): string
Format Mermaid diagram source code.
Options:
• indentSize (number, default: 4) - Number of spaces for indentation • useTabs (boolean, default: false) - Use tabs instead of spaces
formatMarkdownMermaidBlocks(markdown: string, options?: FormatOptions): string
Format all Mermaid code blocks in a Markdown document.
parse(input: string): Diagram
Parse Mermaid source into an AST.
detectDiagramType(input: string): DiagramType
Detect the diagram type from source code.
Formatting Rules
• Diagram declaration at column 0 • Block keywords (critical, alt, loop, par, opt, break, rect, subgraph, end) indented based on nesting depth • Block continuations (else, option, and) at same level as their opening block keyword • Content inside blocks indented by configured amount • Consecutive blank lines collapsed to single blank line • Trailing blank lines removed • Blank line inserted before block starts • Arrow messages normalized when line matches from ARROW to: message pattern (A->>B:msg → A ->> B: msg) • Flowchart class syntax is preserved (A --> B:::warning is not treated as arrow message) • Whitespace normalized (multiple spaces → single, bracket padding removed)
Supported Diagram Types
• sequenceDiagram • flowchart / graph • classDiagram • stateDiagram / stateDiagram-v2 • erDiagram • journey • gantt • pie • quadrantChart • requirementDiagram • gitGraph • mindmap (preserved, indent-sensitive) • timeline (preserved, indent-sensitive) • sankey-beta • xychart-beta • block-beta • architecture-beta
Editor Integration
See Integrations Guide for:
• VS Code setup (tasks, run-on-save) • Pre-commit hooks • GitHub Actions • Prettier plugin
Contributing
Issues and PRs welcome! See GitHub Issues.
License
MIT
Description from the npm listing.
- mermaid
- formatter
- prettier
- prettier-plugin
- diagram
- markdown
- sequence-diagram
- flowchart
- ast
Where mermaid-formatter sits in the listing
Each band is one page of 20. Weekly downloads on a log scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Recent observations
Full history (121)Similar npm Prettier plugins plugins
Data source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/mermaid-formatter. First seen Oct 16, 2026; last successful collection Oct 18, 2026. See the methodology.