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

patchpulse-tui

v2.2.0

Published

An interactive terminal laboratory for visualizing and comparing pathfinding algorithms.

Readme


PatchPulse is an interactive pathfinding laboratory that runs entirely in the terminal. BFS, DFS, Dijkstra, A*, Greedy Best-First, and Bidirectional BFS solve the same grid while you observe the explored nodes, frontier, and final route—without treating the algorithms as black boxes.

The difference shows up in the numbers

On the deterministic showcase scenario, A* finds the same cost-26 route as Dijkstra while visiting roughly 71% fewer nodes.

| Strategy | Visited nodes | Steps | Cost | Peak frontier | |---|---:|---:|---:|---:| | BFS | 252 | 26 | 26 | 15 | | DFS | 49 | 48 | 48 | 49 | | Dijkstra | 255 | 26 | 26 | 20 | | A* | 75 | 26 | 26 | 47 | | Greedy | 30 | 26 | 26 | 36 | | Bi-BFS | 237 | 26 | 26 | 28 |

Reproduce the comparison with npm run benchmark. Visiting fewer nodes does not automatically mean finding the lowest-cost path—that distinction is one of the ideas the laboratory makes visible.

Quick start

PatchPulse requires Node.js 22 or newer.

git clone https://github.com/miguelconfuso/patchpulse.git
cd patchpulse
npm ci
npm run build
npm start

On Windows, you can also open start.cmd after cloning the repository. Once the npm package is released, run it without cloning:

npx patchpulse-tui

What is inside

  • A grid editor for walls, weighted terrain, start, and goal cells.
  • Animated execution with pause, single-step mode, and six speeds.
  • Five scenarios: showcase, weighted, open, maze, and random.
  • Safe diagonal movement that cannot cut through blocked corners.
  • Manhattan, Euclidean, and Chebyshev heuristics.
  • In-app theory, side-by-side comparison, and search metrics.
  • Automatic, dark, and light themes with an 80×24 minimum layout.

Algorithms

| Algorithm | Worst-case time | What it demonstrates | |---|---:|---| | BFS | O(V + E) | Fewest edges on an unweighted graph | | DFS | O(V + E) | Deep exploration without an optimality guarantee | | Dijkstra | O((V + E) log V) | Lowest cost with non-negative weights | | A* | O((V + E) log V) | Dijkstra guided by an admissible heuristic | | Greedy Best-First | O((V + E) log V) | Goal-directed speed without an optimality guarantee | | Bidirectional BFS | O(V + E) | Two BFS waves meeting between start and goal |

V is the number of traversable cells and E is the number of valid neighbour connections. On a grid, E = O(V).

CLI

# Automatic demonstration
npm run demo

# Reproducible comparison
npm run benchmark

# Specific algorithm and scenario
node dist/cli.js --demo --algorithm astar --scenario weighted

# Machine-readable benchmark output
node dist/cli.js --benchmark --scenario maze --json

Run node dist/cli.js --help for every option.

| Key | Action | |---|---| | Arrows or WASD | Move the cursor | | Space / Z | Paint a cell / toggle continuous drawing | | Tab | Cycle wall, weight, eraser, start, and goal tools | | 16 | Select an algorithm | | Enter | Start the animation | | P / N / R | Pause, advance one step, or reset | | G / M / X / C | Cycle scenario, maze, random, or open grid | | I / U | Toggle diagonals or cycle the heuristic | | + / - | Change animation speed | | H / V / ? | Open theory, comparison, or help | | T / Q | Cycle the theme or quit |

Architecture

src/
├── pathfinding.ts   pure algorithms, binary heap, and grid generation
├── scenarios.ts     deterministic scenarios shared by the app and CLI
├── app.tsx          Ink interface, state, and animation
└── cli.tsx          arguments, benchmark, and terminal lifecycle

The search engine does not depend on the interface. The same search() function powers the visualization, benchmark, and tests, keeping each comparison consistent.

Engineering checks

npm ci
npm run check

npm run check runs focused examples and seeded property tests, checks TypeScript, and creates the production bundle. The property suite compares A* with Dijkstra and Bidirectional BFS with BFS across 500 reproducible grids. CI repeats the same locked installation and verification on every push and pull request.

Project documents

Credits

The visual language was inspired by Yoinks, by Pablo Stanley. The simplicity review follows ideas from Ponytail. No brand, component, or implementation from either project was copied.

License

MIT — use it, study it, and adapt it.