voidcosmos / npkill

List any node_modules ๐Ÿ“ฆ dir in your system and how heavy they are. You can then select which ones you want to erase to free up space ๐Ÿงน
https://npkill.js.org
MIT License
8.33k stars 188 forks source link

Enable '--delete-all' feature plz #176

Closed mokone91 closed 6 months ago

mokone91 commented 7 months ago

Hi! I have a repos with 50+ packages it each, this feature will be very useful for me. Please enable it

Thanks! Eldar.

zaldih commented 7 months ago

Thank you for opening the issue!

I think it will be a good idea. In fact I've been thinking about it for a while.

At first because of some (very strange and infrequent) bugs it was decided to disable it for security but not to delete it from the code in case someone really needed this feauture, that could clone the project and enable it by modifying the code.

Now they have been fixed a long time ago so I think it would be a good idea to enable it again :) . I'll work on it soon unless someone wants to go ahead and open a PR.

Important

When you start npkill with --delete-all, the user should get a warning that you are sure you want to run the command and that any node_module found in the path (print path) will be deleted. Require confirmation before proceeding.

LordZardeck commented 6 months ago

Any updates on this? This would be a huge efficiency upgrade for our team. We constantly have the need to nuke our node modules, and with our mono repo, we have a number of node_modules directories. This makes the experience of running npkill, selecting all the the directories, waiting for it to finish, then closing the app annoying.

I would also ask that there be an option to auto-confirm so we can just run it and be done. I get the desire to protect the user, but node_modules should be volitile anyway and easy re-installed so even if it deleted it somewhere that wasn't intentional it doesn't actually harm us. Something like npkill -D -y would be great.

zaldih commented 6 months ago

@LordZardeck I like the idea of including -y to skip confirmations. Over the next week I will try to work and launch this.

zaldih commented 6 months ago

This feature has been released in the new version ๐ŸŽ‰ Feel free to leave your feedback or re-open a new issue if there are any problems.

LordZardeck commented 4 months ago

@zaldih Got to use the update for the first time, and it's a nice improvement. One thing I didn't think to clarify, would there be a way to either not show the UI, or have it auto-exit when using delete all? It's a minor annoyance to have to manually close out.