AshirbadGudu

NPkill

開發程式設計v1.0.1
作者:AshirbadGudu更新於 2026-05-17共 2 個版本 · 最新版本釋出於 2026-01-27npkill@clawhub_ashirbadgudu/npkill
指令碼工具#Javascript

據 AlphaMoat 統計,截至 2026-09,NPkill 累計下載 3,454 次、獲 0 個星標,在全部 5,078 個 AI 技能中排名第 3,215 位,在「開發程式設計」分類(577 個)中排名第 413 位。

累計安裝
106
累計下載
3454
星標
-
全站排名
#3,215
全站前 64% · 「開發程式設計」前 72%
平台累計安裝累計下載星標評論
ClawHub ↗1063366--
SkillHub ↗1063454-—

各平台的計數口徑不同,統計時間不一致。

這個技能是做什麼的

主文說明可用 npkill --dry-run 預覽匹配項,並透過互動模式逐項選擇;npkill --delete-all --yes 會自動刪除找到的目錄。批次刪除可能移除仍在使用的依賴或構建產物。請先預覽並檢查路徑,從範圍明確的工作區掃描,優先使用互動選擇;不要在未核對列表時執行自動刪除。

資料釋出於 2026-10-29

可以用來做什麼

  • 預覽工作區中匹配的目錄
  • 檢查 .next 或 node_modules 的位置
  • 對確認不再需要的目標使用互動式清理

什麼時候用

  • Node.js 或 Next.js 開發目錄中累積了可刪除的構建產物時
  • 能夠先審查 dry-run 輸出和匹配路徑時
  • 掃描範圍足夠窄且目標目錄確實不再需要時

示例提示詞

以下是根據技能文件生成的示例,不代表實際執行結果。

先執行 npkill --dry-run 並列出匹配路徑,不要刪除
僅檢查指定專案下的 .next 目錄
說明 npkill --delete-all --yes 的刪除範圍和風險

月度資料趨勢

累計下載3454
2753313035062026-06 · 累計下載 28052026-07 · 累計下載 30932026-08 · 累計下載 32432026-09 · 累計下載 345426-0626-09
星標-
0112026-06 · 星標 -2026-07 · 星標 -2026-08 · 星標 -2026-09 · 星標 -26-0626-09

2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。

月份累計下載環比星標
2026-093454—-
2026-083243+4.8%-
2026-073093+10.3%-
2026-062805—-

SKILL.md 原文

以下是作者釋出的原始檔案,按純文字顯示,本站未做修改或稽核;其中的連結不可點選,命令請核實後再執行。抓取於 2026-10-23。

3.7 KB · ClawHub v1.0.1
---
name: npkill
description: Clean up node_modules and .next folders to free up disk space using npkill. Specifically designed to help JavaScript and Next.js developers remove accumulated build artifacts that consume significant storage. Provides both interactive and automated cleanup options with safety checks to protect important system directories.
---

# NPkill - Node.js and Next.js Build Artifact Cleaner

This skill leverages the npkill tool to clean up node_modules and .next folders that accumulate over time from JavaScript and Next.js development, freeing up significant disk space.

## Purpose
展開全部(共 110 行)

This skill addresses a common problem faced by JavaScript and Next.js developers: accumulation of large build artifact folders (node_modules, .next) that consume significant disk space over time. It provides a safe and efficient way to identify and remove these unnecessary folders.

## When to Use This Skill

Use this skill when:
- Your disk space is running low due to accumulated node_modules folders
- You want to clean up old Next.js build artifacts (.next folders)
- You need to maintain a clean development environment
- You want to identify which projects are consuming the most disk space
- You want to perform regular maintenance on your development workspace

## Core Commands

### Interactive Cleanup (Recommended)
```bash
npkill
```
Launches the interactive interface to browse and selectively delete node_modules folders. This is the safest method as it allows you to review each folder before deletion.

### Target .next Folders Specifically
```bash
npkill --target .next
```
Search specifically for .next folders (used by Next.js projects) instead of node_modules.

### Dry Run (Always Recommended First)
```bash
npkill --dry-run
```
Simulates the operation without actually deleting anything. Shows what would be deleted.

### Automated Cleanup (Use with Caution)
```bash
npkill --delete-all --yes
```
Automatically deletes all node_modules folders found. Use only after verifying with dry-run.

### View Sizes in Gigabytes
```bash
npkill --gb
```
Shows folder sizes in gigabytes instead of megabytes for easier reading.

### Scan from Specific Directory
```bash
npkill --directory /path/to/search/from
```
Starts searching from a specific directory instead of current directory.

## Safety Features

- **Warnings for Protected Directories**: npkill highlights system/app directories that shouldn't be deleted with a ⚠️ symbol
- **Interactive Confirmation**: Manual selection required in interactive mode
- **Dry-run Option**: Preview changes before executing any deletions
- **Exclusion Options**: Ability to exclude specific directories from scanning

## Common Use Cases for Next.js Developers

### Clean .next Folders Safely
```bash
# First, preview what would be deleted
npkill --target .next --dry-run

# Then, if satisfied with the preview, run interactively
npkill --target .next
```

### Regular Maintenance
```bash
# Run interactive cleanup to review and selectively delete
npkill
```

### Check Disk Usage
```bash
# View all node_modules folders sorted by size
npkill --sort=size
```

## Best Practices

1. **Always run with --dry-run first** to see what would be deleted
2. **Review warnings carefully** about protected directories marked with ⚠️
3. **Use interactive mode** for safer selective deletion
4. **Consider excluding important project directories** using --exclude if needed
5. **Schedule regular cleanup** to prevent massive accumulation

## Installation Requirements

This skill requires the npkill CLI tool to be installed globally:
```bash
npm install -g npkill
```

## Limitations

- Requires npkill to be installed separately
- May not detect all protected system directories in all environments
- Interactive mode requires terminal with arrow key support

「開發程式設計」分類下的熱門技能

資料月份:2026-09 · 下載/星標/安裝數聚合自公開技能註冊庫(ClawHub、SkillHub),按月更新。口徑說明見資料方法。