DEV Community

Cover image for Cleaning Node.js Build Artifacts with a CLI Tool
Max Roma
Max Roma

Posted on

Cleaning Node.js Build Artifacts with a CLI Tool

Modern JavaScript and TypeScript projects generate a lot of build artifacts.

Directories such as:

  • node_modules
  • .next
  • dist
  • .cache
  • coverage
  • .turbo

appear across almost every project. When you work across many repositories these folders accumulate quickly and can easily consume tens of gigabytes of disk space.

Cleaning them manually is tedious.

So we built a small CLI tool called Dustoff.

What Dustoff Does

Dustoff scans your filesystem for common JavaScript and TypeScript build artifacts and allows you to browse and remove them interactively.

Instead of manually searching for folders, you get a terminal interface that lets you quickly identify and clean up unused build outputs.

Demo

Features

Dustoff includes:

  • scanning for common build artifact directories
  • sorting artifacts by size, path, or age
  • searching and filtering results
  • grouping artifacts by directory
  • keyboard navigation for selecting multiple items
  • safe deletion with confirmation

The goal was to create something simple that removes friction from a common developer problem.

Running Dustoff

You can run it instantly using:

npx dustoff

Or install it globally:

npm install -g dustoff

Open Source

Dustoff is open source and available on GitHub:

https://github.com/westpoint-io/dustoff

Also, here is the website:

We originally built it as an internal utility while working across multiple JavaScript projects and decided to share it publicly once it proved useful.

If you run into similar cleanup issues across projects, curious to hear your feedback.

Built with love by Westpoint

Top comments (1)

Collapse
 
maxim_romaniuc_wp profile image
Max Roma

Built this after repeatedly running into disk space issues across multiple JS projects.
Curious what build artifacts tend to accumulate the most in your workflows.