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

dota2-delete-replays

v1.1.1

Published

Cross-platform CLI that finds and deletes your Dota 2 match replays (.dem) to free disk space. Works on Windows, macOS, and Linux.

Readme

dota2-delete-replays

CI npm version license

A tiny cross-platform CLI that finds and deletes your Dota 2 match replays (.dem files) so they stop eating your disk space. Works on Windows, macOS, and Linux — it detects your OS, finds your Steam installation (including secondary library drives), and cleans up only replay files. Nothing else in your Steam library is ever touched.

Install

npm install -g dota2-delete-replays

Requires Node.js 20 or newer.

Usage

# See what would be deleted first (recommended)
dota2-delete-replays --dry-run

# Delete all replays (asks for confirmation)
dota2-delete-replays

# Delete without the confirmation prompt
dota2-delete-replays --yes

# Machine-readable output for scripts (implies --yes)
dota2-delete-replays --json

# Point at a custom location (a replays folder or a Steam library root)
dota2-delete-replays --path "D:\SteamLibrary"

# Delete only replays older than 30 days — keep your recent wins!
dota2-delete-replays --older-than 30

How it finds your replays

Dota 2 stores downloaded replays at:

<steam-library>/steamapps/common/dota 2 beta/game/dota/replays

The CLI checks the default Steam install location for your OS:

| OS | Default Steam locations checked | | ------- | ----------------------------------------------------------------------------------------------- | | Windows | %ProgramFiles(x86)%\Steam, %ProgramFiles%\Steam, %LocalAppData%\Steam | | macOS | ~/Library/Application Support/Steam | | Linux | ~/.steam/steam, ~/.local/share/Steam, Flatpak (~/.var/app/com.valvesoftware.Steam/...), Snap |

It also parses steamapps/libraryfolders.vdf, so replays on secondary drives (e.g. D:\SteamLibrary) are found too. On Windows it additionally reads Steam's InstallPath straight from the registry, so custom install locations are detected as well.

Only files ending in .dem inside the replays folder are deleted. Match history, screenshots, config, and everything else stays put.

Safety

  • --dry-run shows exactly what will be removed before you commit.
  • Interactive confirmation prompt unless you pass --yes or --json.
  • Deleting a replay only removes your local downloaded copy — replays can be re-downloaded from the Dota 2 client while Valve still has them.

Development

npm install
npm run build       # bundle with tsup -> dist/cli.js
npm test            # vitest (happy + unhappy paths)
npm run typecheck   # TypeScript 7 strict mode

Release

CI runs on Ubuntu, macOS, and Windows. Pushing a v* tag publishes to npm via GitHub Actions (requires an NPM_TOKEN repository secret).

Security & supply chain

This is read-only open source: the code is public so you can audit it, but pull requests and external contributions are not accepted — repository interaction limits restrict issues/PRs to collaborators only. This is a deliberate supply-chain security measure.

Protections in place: branch protection on main (no force pushes, linear history), read-only GITHUB_TOKEN in CI, manual approval required before any forked-PR workflow can run, secret scanning with push protection, Dependabot security updates, npm provenance on releases, and only two runtime dependencies (commander, chalk). See SECURITY.md for details and how to report vulnerabilities privately.

License

MIT