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 πŸ™

Β© 2025 – Pkg Stats / Ryan Hefner

mermaid-viewer-cli

v1.0.3

Published

> ✨ A sleek Node.js CLI tool to **view, edit, and export Mermaid diagrams** β€” powered by 🐚 `commander`, ⚑ `TailwindCSS`, and 🧠 `Mermaid.js`.

Downloads

197

Readme

🧭 Mermaid Diagram Viewer CLI

✨ A sleek Node.js CLI tool to view, edit, and export Mermaid diagrams β€” powered by 🐚 commander, ⚑ TailwindCSS, and 🧠 Mermaid.js.


License Node

πŸ“Έ Screenshot

View

🎨 Features

  • βœ… Beautiful HTML Preview β€” dark mode using TailwindCSS πŸŒ™
  • βœ… Split View β€” source on the left, live-rendered diagram on the right πŸͺž
  • βœ… Live Editing β€” instantly re-render as you type ✍️
  • βœ… Zoom In / Out β€” smooth control for detailed diagrams πŸ”
  • βœ… Export Options β€” download as SVG πŸ–ΌοΈ or PNG πŸ“Έ
  • βœ… Keyboard Shortcuts β€” save & refresh with ease ⌨️
  • βœ… Local File Support β€” provide a .mmd file via CLI

πŸš€ Installation

npm install -g mermaid-viewer-cli

or run directly with npx:

npx mermaid-viewer-cli -f diagram.mmd

βš™οΈ Usage

πŸ”§ Basic Command

mermaid-viewer -f your-diagram.mmd

πŸ“‚ Options

| Option | Description | | --------------------- | ----------------------------------------------- | | -f, --file <path> | Path to the Mermaid file (.mmd or .mermaid) | | -p, --port <number> | Specify port for local preview (default: 3000) |


πŸ§‘β€πŸ’» Live Editing

  • πŸ’‘ The left pane is your editable Mermaid source code.
  • πŸͺ„ The right pane shows the rendered diagram in real time.
  • 🧷 Press Ctrl+S (or Cmd+S) to save changes back to the file.

πŸ“€ Export Options

At the top-right corner, you’ll find export buttons:

  • πŸ–ΌοΈ Download SVG β€” for scalable vector diagrams

(Make sure you allow pop-ups in your browser for download dialogs.)


🌈 Example

Here’s a sample Mermaid file you can test with:

graph TD
    A[Start] --> B{Is it working?}
    B -->|Yes| C[Awesome! πŸŽ‰]
    B -->|No| D[Check your syntax 🧩]
    D --> B

Save it as example.mmd, then run:

mermaid-viewer -f example.mmd

🧾 Example Output

πŸ–₯️ The app opens a browser window that looks like this:

+-------------------------------------------+-------------------------------------------+
| πŸ“ Mermaid Source                         | 🧩 Live Diagram                            |
|-------------------------------------------|-------------------------------------------|
| graph TD                                  |     [Rendered Flowchart]                  |
|   A --> B                                 |                                           |
|   B --> C                                 |                                           |
|-------------------------------------------|-------------------------------------------|
| Ctrl+S to save Β· Zoom controls Β· Export   |                                           |
+-------------------------------------------+-------------------------------------------+

Salesforce sandboxes example

flowchart TB

    %% Colors
    classDef dev fill:#4ade80,stroke:#166534,color:#fff;          %% green
    classDef int fill:#60a5fa,stroke:#1e3a8a,color:#fff;          %% blue
    classDef qa fill:#fbbf24,stroke:#92400e,color:#fff;           %% amber
    classDef uat fill:#f472b6,stroke:#9d174d,color:#fff;          %% pink
    classDef preprod fill:#a78bfa,stroke:#4c1d95,color:#fff;      %% purple
    classDef prod fill:#ef4444,stroke:#7f1d1d,color:#fff;         %% red

    %% Nodes
    DEV1["Dev Sandbox 1"]
    DEV2["Dev Sandbox 2"]
    DEV3["Dev Sandbox 3"]

    INT["Integration Sandbox"]
    QA["QA Sandbox"]
    UAT["UAT Sandbox"]
    PREPROD["Pre-Prod Sandbox"]
    PROD["Production Org"]

    %% Flow
    DEV1 --> INT
    DEV2 --> INT
    DEV3 --> INT

    INT --> QA
    QA --> UAT
    UAT --> PREPROD
    PREPROD --> PROD

    %% Apply classes
    class DEV1,DEV2,DEV3 dev
    class INT int
    class QA qa
    class UAT uat
    class PREPROD preprod
    class PROD prod

πŸ§‘β€πŸŽ¨ Future Enhancements

  • 🧭 Multiple tabs for multiple diagrams
  • 🧱 Syntax highlighting for Mermaid editor
  • πŸ”„ Auto-save + diagram history snapshots

🧑 Credits

Built with ❀️ by Mohan Chinnappan