Easily find and remove old and heavy node_modules 📦, artifacts, caches and dev leftovers 🧹
翻译准备中
正在加载完整 README。
查看完整 README ↗Your system remembers everything. npkill helps you forget. This tool scans your system for heavy and unnecessary development directories. It shows you what is taking up space, when you stopped using it, why it’s there, and lets you remove it in seconds.
Beyond node_modules
Started with node_modules, extended to entire development environments.
Remove build artifacts, caches, temp files, and other heavy leftovers using built-in or custom profiles.
Profiles-first scanning
Scan your system using predefined profiles for Node.js, Python, Rust, game engines, and more. Or create your own to match your workflow.
Effortless by default
A clean and responsive TUI designed to stay out of your way.
See everything clearly, make decisions fast, and clean with confidence.
Workspace awareness
See at a glance when you last worked in that workspace and find out if it's an active project or a long-forgotten one.
Built for speed
npkill is written in TypeScript, but searches are performed at a low level, delivering blazing-fast performance and near-instant responsiveness.
Simply use the following command:
$ npx npkill
By default, npkill will start searching for node-related development directories from the directory where you ran it, using the built-in node profile.
As the target directories are found, they will be listed for you.
[!NOTE] TL;DR: You can learn everything as you go because the TUI explains itself.
You can navigate between them with ↓ ↑, and use Space or Del to delete the selected folder.
You can view more information about the result by pressing → and go back by pressing ←.
If necessary, you can open the parent directory with o.
You can see more navigation keys in the built-in quick reference panel.
[!WARNING] Some applications installed on the system need their node_modules directory to work and deleting them may break them. npkill will try to identify them and highlight them by displaying a :warning: to be careful.
[!IMPORTANT] npkill find candidates for deletion but does not decide what is safe for you.
- Results are based on common conventions.
- Whether a folder is safe to delete always depends on the scope.
Always review results before deleting anything.
This mode allows you to select and delete multiple folders at once, making it more efficient when cleaning up many directories.
Press t to toggle multi-select mode. When active, you'll see a selection counter and additional instructions at the top of the results.
After pressing v to enter range selection mode:
Divide and conquer.
You can filter the results displayed by pressing /. What you type will then appear in the yellow bar at the top.
Press Enter to browse through the filtered results.
To clear the filter, press / again and delete the term, or press Esc while typing.
This feature can be especially useful for narrowing down results by path without restarting npkill.
[!NOTE] The search supports regular expressions. For example,
/work/.*/datakeeps the results inside aworkdirectory that havedatasomewhere in their path.
Profiles are a set of targets that represent a development ecosystem.
You can list the available profiles with npkill --profiles and use them as follows: npkill --profiles node,python.
Profiles and their targets may change between versions of npkill. So if this is important to you, I recommend creating your own with .npkillrc.
The .npkillrc file allows you to define the default behavior of npkill without having to pass parameters every time. It is also where you can define your own custom profiles.
You can read all the details in the .npkillrc documentation.
以上为 README 的开头部分。其余内容请阅读原文。 查看完整 README ↗