Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lucasepe/modgv

Converts 'go mod graph' output into Graphviz's DOT language
https://github.com/lucasepe/modgv

dependencies golang graphviz viewer

Last synced: 19 days ago
JSON representation

Converts 'go mod graph' output into Graphviz's DOT language

Awesome Lists containing this project

README

        

# modgv

[![Go Report Card](https://goreportcard.com/badge/github.com/lucasepe/modgv)](https://goreportcard.com/report/github.com/lucasepe/modgv)     [![Go API Reference](https://img.shields.io/badge/go-docs-blue.svg?style=flat)](https://pkg.go.dev/github.com/lucasepe/modgv?tab=doc)     [![Mentioned in Awesome Go](https://awesome.re/mentioned-badge-flat.svg)](https://github.com/avelino/awesome-go#package-management)

Converts 'go mod graph' output into [GraphViz](https://graphviz.gitlab.io/download/)'s DOT language.

- takes no options or arguments
- it reads the output generated by “go mod graph” on stdin
- generates a DOT language and writes to stdout

## Usage:

```bash
go mod graph | modgv | dot -Tpng -o graph.png
```

For each module:
- the node representing the greatest version (i.e., the version chosen by Go's MVS algorithm) is colored green
- other nodes, which aren't in the final build list, are colored grey

## Installation

### From [binary releases](https://github.com/lucasepe/modgv/releases) (macOS, Windows, Linux)

memo currently provides pre-built binaries for the following:

- macOS (Darwin)
- Windows
- Linux

1. Download the appropriate version for your platform from [memo releases](https://github.com/lucasepe/modgv/releases).

2. Once downloaded unpack the archive (zip for Windows; tarball for Linux and macOS) to extract the executable binary.

3. If you want to use from any location you must put the binary executable to your `Path` or add the directory where is it to the environment variables.

### Using [`Go`](https://go.dev/dl/) toolchain

```bash
git clone https://github.com/lucasepe/modgv.git
cd modgv
go install
```

Here 👉 https://graphviz.gitlab.io/download/ how to install [GraphViz](https://graphviz.gitlab.io/download/) for your OS.

## Sample output (PNG)

```bash
go mod graph | modgv | dot -Tpng -o graph.png
```

![](./graph.png)

---

## Sample output (PDF with clickable links to module docs)

```bash
go mod graph | modgv | dot -Tps2 -o graph.ps
ps2pdf graph.ps graph.pdf
```