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

algoviz-tui

v1.0.0

Published

Step through C++, Python, and JavaScript algorithms in your terminal using native debuggers

Readme


What is AlgoViz?

AlgoViz is a terminal UI that lets you step through any algorithm line-by-line and watch variables change in real time — directly in your terminal. No browser, no IDE plugins, no setup hassle.

It hooks into native debuggers to execute your code exactly as your compiler/interpreter would, while extracting live variable snapshots at every step.

╭──────────────────────────────────────╮╭──────────────────────────╮
│ 📄 bubble_sort.cpp → bubbleSort()    ││ 🔍 Variables (step #12)  │
│  10 │     for (int j = 0; ...        ││   Name     │ Value       │
│  11 │         if (arr[j] > arr[j+1]) ││   ─────────┼──────────── │
│  12 │             swap(arr[j], ...   ││ ▶ arr      │ size=7      │
│  13 │             swapped = true;    ││ ▶ i        │ 1           │
│  14 │         }                      ││ ▶ j        │ 3           │
│  15 │     }                          ││   swapped  │ true        │
│  ───── 10–15 of 44 lines ──────────  ││   n        │ 7           │
╰──────────────────────────────────────╯╰──────────────────────────╯
╭────────────────────────────────────────────────────────────────────╮
│ Space:Step  A:Auto  R:Restart  Q:Quit     C++  ● ready  L:12 #12 │
╰────────────────────────────────────────────────────────────────────╯

Installation

# Clone the repository
git clone https://github.com/yourusername/algoviz-tui.git
cd algoviz-tui

# Install dependencies
npm install

# Link the global command
npm link

That's it. You now have the algoviz command available anywhere in your terminal.


Usage

algoviz <file>

Examples

# Step through a C++ sorting algorithm
algoviz bubble_sort.cpp

# Visualize a Python script
algoviz fibonacci.py

# Step through JavaScript
algoviz two_sum.js

# Auto-step mode (animates at 300ms intervals)
algoviz bubble_sort.cpp --auto --speed 300

# Force a language for files without standard extensions
algoviz myfile.txt --lang python

Try the included examples

algoviz examples/bubble_sort.cpp
algoviz examples/bubble_sort.py
algoviz examples/fibonacci.js

Controls

| Key | Action | |-----|--------| | Space / N / Enter | Step to next line | | A | Toggle auto-step mode | | R | Restart execution (when finished) | | Q / Ctrl+C | Quit |


How It Works

AlgoViz doesn't transpile or simulate your code. It executes it natively using the real compilers and interpreters on your system, then hooks into each language's debugger infrastructure to control execution:

C++ → LLDB

Your .cpp file
     │
     ▼
clang++ -g -O0 ──→ Debug binary
     │
     ▼
LLDB SB API (via Python bridge)
     │
     ├─ BreakpointCreateByName("main")
     ├─ StepOver() on each keypress
     └─ GetVariables() → JSON → TUI

Compiles your code with debug symbols, then drives LLDB's Python API to step through execution and extract variable values from stack frames.

Python → sys.settrace

Your .py file
     │
     ▼
compile() + exec() with sys.settrace hook
     │
     ├─ Intercepts every 'line' event
     ├─ Captures frame.f_locals
     └─ Streams JSON payloads → TUI

Uses Python's built-in tracing mechanism to intercept every line of execution. print() output is captured separately and forwarded to the console panel.

JavaScript → Node Inspector

Your .js file
     │
     ▼
node --inspect-brk (Chrome DevTools Protocol)
     │
     ├─ Debugger.stepOver on each keypress
     ├─ Runtime.getProperties for scope variables
     └─ WebSocket JSON messages → TUI

Launches Node.js with the inspector protocol, connects over WebSocket, and drives execution via CDP commands.


Requirements

| Language | Requirement | |----------|-------------| | C++ | clang++ (Xcode Command Line Tools) + LLDB | | Python | python3 (3.8+) | | JavaScript | node (18+) | | Runtime | Node.js 18+ for the TUI itself |

macOS

# Install Xcode Command Line Tools (provides clang++ and LLDB)
xcode-select --install

Linux

# Install LLDB and Clang
sudo apt install clang lldb python3-lldb

TUI Layout

┌─────────────────────┬──────────────────┐
│                     │                  │
│   📄 Source View    │  🔍 Variables    │
│                     │                  │
│   Line-by-line      │  Live scope      │
│   with syntax       │  with change     │
│   highlighting      │  detection       │
│                     │                  │
│                     ├──────────────────┤
│                     │                  │
│                     │  💻 Console      │
│                     │                  │
│                     │  stdout/stderr   │
│                     │                  │
├─────────────────────┴──────────────────┤
│  Status Bar: Controls + Language + Line │
└────────────────────────────────────────┘
  • Source View — Your code with syntax highlighting. Current line is marked with a cyan highlight. Auto-scrolls to follow execution.
  • Variable Table — All in-scope variables. marks changed values (yellow), + marks new variables (green).
  • Console — Real-time stdout/stderr from your program.
  • Status Bar — Keyboard shortcuts, language badge, line number, step count.

CLI Options

Usage: algoviz [options] <file>

Arguments:
  file                   Source file to visualize (.py, .js, .cpp, .c)

Options:
  -V, --version          Output the version number
  -s, --speed <ms>       Auto-step interval in milliseconds (default: 500)
  -a, --auto             Start in auto-step mode
  -l, --lang <language>  Force language (python, cpp, javascript)
  -h, --help             Display help

Supported File Extensions

| Extension | Language | |-----------|----------| | .cpp, .cc, .cxx, .c, .hpp | C++ | | .py | Python | | .js, .mjs | JavaScript |


License

MIT