1.2 KiB
1.2 KiB
mermaid-diagram-creator
A CLI tool to convert Mermaid diagram files (.mmd) to SVG format.
Features
- Convert Mermaid diagram text files to SVG
- Easy command-line interface
- Fast rendering with
beautiful-mermaid - Input validation with Zod
Installation
1. Set up the project
bun install
2. Create symlink to your user bin directory
ln -s /Users/my_user_name/project_dir/mermaid-diagram-creator/bin/mmd-to-svg ~/.local/bin/mmd-to-svg
Usage
mmd-to-svg <input.mmd> <output.svg>
Hot Reloading
Using entr
echo docs/diagrams/create_thing.mmd | entr mmd-to-svg ./docs/diagrams/create_thing.mmd ./docs/diagrams/create.svg
Example
mmd-to-svg example.mmd diagram.svg
This will read the Mermaid diagram from example.mmd and output the rendered SVG to diagram.svg.
Example diagram file (example.mmd)
graph TD
A[Start] --> B{Decision}
B -->|Yes| C[Action]
B -->|No| D[End]
Development
Run directly:
bun index.ts example.mmd output.svg
Built with Bun - a fast all-in-one JavaScript runtime.