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

@gi11i4m/dia-log

v0.1.11

Published

Visualize git logs and TODO counts on your architecture diagram

Readme

dia-log

Annotate a Mermaid architecture diagram with TODO comment counts or git changes, mapped to the modules in your project.

Getting started

1. Scaffold config files

npx dia-log init

Creates files in your project:

| File | Purpose | |---|---| | dia-log/base.mmd | Your architecture diagram in Mermaid syntax | | dia-log/mapping.json | Maps each diagram node to a source directory |

2. Edit dia-log/mapping.json

Point each key at a real source directory in your repo:

{
  "adapter_in": "src/adapter/in"
}

Paths are relative to your repository root. If a path doesn't exist, the tool will warn you and skip that node.

3. Optionally update dia-log/base.mmd

The scaffolded diagram shows a single hexagonal module. Add more subgraphs, change node labels, or restructure the layout to match your architecture. Node IDs in base.mmd must match the keys in mapping.json.

4. Generate

Annotate with TODO comment counts:

# All TODOs
npx dia-log --todos

# Only TODOs containing a specific string (e.g. a ticket ID)
npx dia-log --todos IOM-1425

Annotate with git changes:

# Open / uncommitted changes (staged + unstaged)
npx dia-log --changes

# Changes introduced by the last commit
npx dia-log --changes HEAD~1

# Last N commits combined
npx dia-log --changes HEAD~5

# Diff vs another branch or tag
npx dia-log --changes main
npx dia-log --changes v1.0..HEAD

Output is written to dia-log/generated.mmd.

5. View

Open dia-log/generated.mmd in any Mermaid viewer:


Change colours

| Class | Used for | Default colour | |---|---|---| | core | Adapters, Application, Domain | amber | | port | Port In / Port Out | yellow | | sk | Shared Kernel, Mapping | purple | | infra | Infrastructure modules | grey | | orchestrator | Orchestrator / main module | blue | | lib | Standalone libraries | green |

Edit the classDef lines in base.mmd to customise.


Help

npx dia-log --help

Contributing / local dev

git clone <repo>
cd dia-log
npm install

Run the tool locally from the dia-log/ folder:

npm run dia-log             # --todos, opens generated.mmd in IntelliJ
npm run dia-log:changes     # --changes
npm run dia-log:last-commit # --changes HEAD~1

How the code is structured

| File | Role | |---|---| | bin/cli.js | CLI entry point — parses commands/flags via commander, sets DIA_LOG_ROOT, delegates to generate.js | | generate.js | Core logic — reads mapping.json + base.mmd, walks files or queries git, injects annotations, writes generated.mmd | | init/ | Scaffold templates copied by npx dia-log init |

Adding a new node style

  1. Add a classDef line in init/base.mmd (e.g. classDef myStyle fill:#abc)
  2. Apply it to nodes with :::myStyle
  3. Document the new class in the colour table above