allow deletion without using TUI
Problem
It would be nice to be able to use npkill without using the TUI as it is a potential extra step/click/key and a slight(:-P) performance impediment.
Solution
Add a command line argument that skips the UI, runs npkill deletion service, and displays results on command line.
Alternative
The best set of arguments I have found thus far is npx npkill -D -x -y -nu which deletes node_modules, skips hidden stuff, auto-confirms, doesn't check for updates, but still requires an exit of the TUI.
Great suggestion, I need this too, especially in the CI process, where it is necessary to automatically execute the subsequent scripts.
I have a similar requirement, to have a proper non-interactive mode so i can call this as a CI script. The -D option suggests non-interactive but we also define the -y option. This is described as "Avoid displaying a warning when executing --delete-all" rather than acting as a non-interactive input mode.
A simple test is to pipe npkill through cat (npkill | cat) which confirms the command needs a TTY: "Oh no! Npkill does not support this terminal (TTY is required). This is a bug, which has to be fixed. Please try another command interpreter (for example, CMD in windows)".
It would be great to remove this condition and fix the bug as mentioned, (with -D and/or -y) to run non interactively. Thanks!
Hey @zaldih, first off, thanks a lot for this incredibly useful package! I find myself using it all the time.
I'm currently in need of this feature (allow deleting node_modules without the UI) I was wondering if you'd be open to accepting a PR for this implementation?
I noticed there hasn't been much recent interaction in the issues tab, so I wanted to ask before diving in.
Hi everyone! Sorry for the delay.
Some time ago I started working on this but due to lack of time I had to pause it.
I'm working on this: #205 , which will allow to deal with this by allowing to run npkill without ui, directly from a script.
I know the main issue is to run it directly without ui and without having to create custom node scripts, but with the changes I'm making that should be coming soon in the following weeks :)
@khaledtb If you are still interested, as soon as I finish the work on the api refactor, you could of course get your hands on it to fix the TTY problem that @craigryan mentions.
when is this being shipped?