NPkill
by @ashirbadgudu
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.
clawhub install npkillπ About This Skill
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
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:
Core Commands
Interactive Cleanup (Recommended)
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
npkill --target .next
Search specifically for .next folders (used by Next.js projects) instead of node_modules.Dry Run (Always Recommended First)
npkill --dry-run
Simulates the operation without actually deleting anything. Shows what would be deleted.Automated Cleanup (Use with Caution)
npkill --delete-all --yes
Automatically deletes all node_modules folders found. Use only after verifying with dry-run.View Sizes in Gigabytes
npkill --gb
Shows folder sizes in gigabytes instead of megabytes for easier reading.Scan from Specific Directory
npkill --directory /path/to/search/from
Starts searching from a specific directory instead of current directory.Safety Features
Common Use Cases for Next.js Developers
Clean .next Folders Safely
# First, preview what would be deleted
npkill --target .next --dry-runThen, if satisfied with the preview, run interactively
npkill --target .next
Regular Maintenance
# Run interactive cleanup to review and selectively delete
npkill
Check Disk Usage
# 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:
npm install -g npkill
Limitations
π Tips & 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