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

unidirstat

v0.1.3

Published

Universal cross-platform disk usage analyzer (unidirstat). One CLI — npx unidirstat — auto-detects OS and launches WinDirStat (Windows), MacDirStat (macOS) or LinDirStat (Linux) with treemap and cleanup tools.

Readme

unidirstat

Universal cross-platform disk usage visualizer — one CLI for every OS.

npx unidirstat auto-detects your platform and launches the native experience:

  • Windows → WinDirStat
  • macOS → MacDirStat
  • Linux → LinDirStat

Same UI, same features, OS-native backends. Inspired by WinDirStat, rebuilt for the modern stack.

logo

Quick Start

npx unidirstat
npx unidirstat ~/Documents
npx unidirstat / --port 5173 --no-open
# also aliased as dirstat
npx unidirstat --help

Or install globally:

npm i -g unidirstat
unidirstat ~/Downloads

The CLI starts a local Node backend on a random port, scans the target, and opens the browser UI automatically (http://localhost:<port>).

What You Get

Frontend (shared web UI, ported from the macdirstat demo):

  • Native window chrome (traffic lights, titlebar, menubar, toolbar)
  • Tree view with Size Proportion bars, %, Physical/Logical Size, Files — expandable, selectable, synced with treemap
  • Extension legend (.dmg, .mp4, .zip, .app, …) with color swatches
  • Treemap with glossy tiles, hover labels, selection sync — squarified layout scaled by size
  • Status bar with selection, size, file count, memory
  • Progress bar + Scan Again / Rescan

Backend (Node launcher + OS adapters):

  • Windows: NTFS/ReFS scan, Reveal in Explorer, Delete / Recycle Bin
  • macOS: APFS/HFS+ scan, Reveal in Finder, Move to Trash, Quick Look, mount awareness
  • Linux: ext4/btrfs/xfs, reveal in file manager, trash/delete

All Menus Are Functional

  • File: Open directory/drive, Rescan current, Export report (JSON), Save snapshot, Quit
  • Edit: Copy path, Copy selected info, Select all / Deselect
  • Clean Up: Reveal in file manager, Move to Trash / Recycle Bin, Delete permanently
  • View: Toggle columns, Color mode, Toggle treemap, Dark/light, Sort (name/size/files)
  • Tools: Largest files, Duplicate hint, Filter by extension, Ignore patterns, Volume info, Open terminal at folder
  • Options: Exclusions (e.g. node_modules), Symlink handling, Hidden files, Performance limits
  • Help: Keyboard shortcuts, Version, Issue reporting, About

Architecture

unidirstat (CLI: bin/dirstat.js)
  ├─ detects process.platform → Win/Mac/LinDirStat branding
  ├─ starts server.js (HTTP + scan + actions) on free port
  ├─ opens browser to http://localhost:<port>
  └─ serves public/index.html + public/app.js (treemap/tree/legend)

server.js
  ├─ scanDir(root, opts) → recursive fs.readdir/stat, size aggregation
  ├─ adapters/os.js → reveal/trash/delete per platform
  └─ HTTP API:
     GET  /api/health
     GET  /api/scan?path=/some/dir
     POST /api/action {action, path}

Stack: Node.js + vanilla HTML/CSS/JS + Canvas treemap. Future: Rust scanner core for 10× speed.

CLI Options

Usage:
  npx unidirstat [path] [options]

Options:
  --help, -h       Show help
  --version, -v    Show version
  --port <n>       Port (default: 0 = random free port)
  --no-open        Don't auto-open browser
  --host <host>    Host (default: 127.0.0.1)

Development

git clone https://github.com/dirstat/dirstat.git
cd dirstat
npm install
node bin/dirstat.js ~/Documents

License

MIT — new inspired logo recommended (don’t reuse exact WinDirStat logo verbatim).