A handy, lightweight CLI tool to identify and remove node_modules directories. Written in Rust for blazing-fast performance.
This utility recursively searches for node_modules directories starting from your current working directory (or a specified path), calculates their size and presents an interactive menu to select and delete what you no longer need.
- π Blazing Fast: Written in Rust, optimizing recursion and size calculations.
- β‘ Lightweight & Efficient: Minimal memory and CPU footprint β ideal for virtual machines, CI/CD environments, and resource-constrained systems.
- π Smart Sorting: Sort discovered directories by size (largest first) or by file path (A-Z).
- π― Interactive Control: Simple, intuitive TUI interface to review, select and batch-delete items.
- π¦ Zero Runtime Dependencies: Single self-contained binary, no Node.js runtime required to clean up your projects.
Download the latest compiled binary for your platform directly from the GitHub Releases page - no Rust toolchain required.
Requires Rust 1.95 or later:
cargo install npkl
git clone https://github.com/valsaven/npkl.git
cd npkl
cargo build --releaseNote: The release profile already enables strip, lto, and codegen-units = 1 for a minimal binary footprint (~396 KB).
npkl [path] [--sort size|path][path]- Optional target directory to scan. Defaults to the current directory (.).--sort <MODE>- Controls entry sorting:size(largest first, default) orpath(A-Z).
- Up/Down Arrows: Move selection
- Space: Toggle entry selection
- Enter: Confirm and delete selected directories
- Esc: Quit without making changes
cargo testThis project is licensed under the MIT License - see the LICENSE file for details.