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

mermaidtui

v0.0.5

Published

Deterministic Unicode and ASCII Mermaid diagram renderer for the terminal

Readme

mermaidtui

Deterministic, readable Unicode/ASCII rendering of Mermaid diagrams in your terminal. By Tariq Shams.

Sometimes you need to visualize a diagram in a terminal environment: TUI apps, CI logs or just quick terminal previews, where SVG or heavy headless browsers aren't an option. mermaidtui provides a lightweight engine to render simple Mermaid flowcharts as clean Unicode or ASCII boxes. Written in TypeScript.

Features

  • Standard Mermaid Syntax: Supports a subset of the Mermaid flowchart syntax.
  • Unicode & ASCII: Beautiful Unicode boxes by default, with an ASCII fallback mode.
  • Deterministic Layout: Grid-based layout engine that prioritizes readability.
  • Zero Heavy Dependencies: No Mermaid internals, no Chromium/Puppeteer, no SVG conversion.

Supported Syntax (v0.0.5)

Currently v0.0.5 supports a robust subset of flowcharts:

flowchart LR
    A[Start Here] --> B[Process A] --> C[End Goal]
    B --> D[Process B]
  • Directions: LR, RL, TB, BT.
  • Nodes: Alphanumeric IDs and square labels A[Label with spaces].
  • Edges: Directed arrows -->, including Chained Edges (A --> B --> C).
  • Visuals: Intelligent corner rendering (, , , ) for orthogonal paths.

Showcase

Complex LR Layout

Input:

flowchart LR
    A[Root] --> B[Top Node]
    A --> C[Bottom Node]
    B --> D[Final]
    C --> D

Output:

              ┌────────┐                    
          ┌──▶│Top Node│─────┐              
          │   └────────┘     │              
┌────┐    │                  │     ┌─────┐  
│Root│────┐                  └─┌──▶│Final│  
└────┘    │                    │   └─────┘  
          │                    │            
          │   ┌───────────┐    │            
          └──▶│Bottom Node│────┘            
              └───────────┘                 

Complex TB Layout

Input:

flowchart TB
    A[Root] --> B[Left Node]
    A --> C[Right Node]
    B --> D[Final]
    C --> D

Output:

            ┌────┐               
            │Root│               
            └────┘               
               │                 
               │                 
     ┌─────────└─────────┐       
     ▼                   ▼       
┌─────────┐        ┌──────────┐  
│Left Node│        │Right Node│  
└─────────┘        └──────────┘  
     │                   │       
     │                   │       
     └─────────┌─────────┘       
               ▼                 
            ┌─────┐              
            │Final│              
            └─────┘              

Installation

npm install mermaidtui

Usage

CLI

# Render a file
mermaidtui diagram.mmd

# Pipe input
cat diagram.mmd | mermaidtui --ascii

Library

import { renderMermaidToTui } from 'mermaidtui';

const input = `flowchart LR
    A[Start] --> B[End]`;

const output = renderMermaidToTui(input, { ascii: false });
console.log(output);

Collaborators & Local Development

We welcome contributions! To test changes locally across repositories:

  1. Clone & Link:

    git clone https://github.com/tariqshams/mermaidtui.git
    cd mermaidtui
    npm install
    npm run build
    npm link
  2. Use in another project:

    cd ../your-other-project
    npm link mermaidtui
  3. Run Tests:

    # Run unit tests
    npm test
    
    # View visual output for all test cases
    npm run dump-visual-test

License

Apache 2.0