Skip to content

v1.0 - Because the problem is modern development.

Latest

Choose a tag to compare

@zaldih zaldih released this 12 Nov 12:25
npkill 1.0.0 cover

npkill started in 2019 as a small script to hunt node_modules. Six years later, node_modules is only part of what piles up on a dev machine. Every framework and language leaves its own build outputs and caches behind.

If you don't want to change anything, you don't have to. npx npkill works as always, it just finds a lot more.

You can read all the details of this update in this post or watch the teaser (1:15).

Added

  • Added profiles: sets of targets that represent a development ecosystem. The default one is node, which finds node_modules and also .next, .nuxt, .angular, .turbo and friends. There are 20 built-in profiles (python, rust, java, dotnet, unity...). Use them with --profiles node,python or list them with --profiles. More info.
  • Added smart targets: some folders are only shown when the files around them confirm what they are. For example, target only appears next to a Cargo.toml or pom.xml.
  • Added .npkillrc: define your default options and your own profiles. npkill looks for ./.npkillrc first and then for ~/.npkillrc. You can also use --config. More info.
  • Added panels: navigate with ← and → between Help, Options, the results and Info.
    • Help: quick reference with all the shortcuts.
    • Options: change the sort, the targets or the directory without restarting npkill.
    • Info: details of the result under the cursor, like the exact date of the last change or the risk of deleting it.
  • Added multi-select mode: press t to select several results and delete them at once. Use v to select a range and a to select all.
  • Added search: press / to filter the results by name or path. It supports regex.
  • Added JSON output: --json prints all the results as a single object and --json-stream prints one result per line as they are found. Both can delete without the interface with --delete-all -y. More info.
  • Added API: the core is now separated from the cli, so you can use npkill from your own code with import { Npkill } from 'npkill'. More info.
  • Added multiple targets: --targets node_modules,.cache.
  • Added --older-than: only show results whose project has not been modified in the given number of days (#271, thanks @Shreyakb301).
  • Added --no-size, --no-age and --no-stats to skip the calculations you don't need (#246, #250, thanks @yetanotheraryan and @StanislavKozachenko).
  • Added --size-unit (auto, mb, gb). With auto the unit changes between MB and GB by itself.
  • Added --no-ignore-default to also look inside the folders that npkill skips by default, like .git or .nvm.
  • Added scrollbar to the results. Yes, it didn't have one. I'd rather not talk about it.
  • Added results counter and the active profiles in the header.

Changed

  • ❗ Changed --target to --targets.
  • ❗ Changed --exclude-hidden-directories to --exclude-sensitive. -x no longer hides the "dot" directories, it hides the results marked as sensitive.
  • ❗ Changed --delete-all: now it requires --targets. Nothing is deleted automatically unless you say exactly what.
  • ❗ Changed --sort last-mod to --sort age. The Last_mod column is now Age.
  • ❗ Changed -gb to --size-unit gb.
  • ❗ Removed --bg-color.
  • ❗ Unknown options are now rejected instead of ignored.
  • Changed --exclude: now it accepts patterns. A name matches anywhere, ./path matches from the scan root and **/path matches at any depth (#269, thanks @Ludvins and @NyaGarcia).
  • Changed search engine: workers now share memory. Up to 3x faster searches (#281).
  • Changed size calculation: it now runs in the workers and no longer follows symlinks.
  • Symlinks are now skipped during the search.
  • Improved the detection of sensitive results.
  • Improved --help output.
  • Improved the "no results" message and the Size and Age loading indicators.
  • Simplified the header. Columns now adapt to the terminal width.
  • Replaced colors with picocolors and removed unused dependencies.
  • Update dependencies.

Fixed

  • Fixed npkill not starting in non-TTY environments.
  • Fixed results flickering when two of them have the same value on sort.
  • Fixed stats going back to their default value when resizing or changing panel.
  • Fixed npkill not working on Android (#275, thanks @kukirin-ui).
  • Fixed the search hanging when the scan fails. Now it exits with the reason.
  • Fixed typo in the exit text (#189, thanks @zaaakher).

Thanks to everyone who reported bugs and shared ideas during all these years. npkill wouldn't be what it is without you.

npx npkill@latest and share your results!

v0.12.2...v1.0.0