Created
July 13, 2021 16:38
-
-
Save zlocate/83f245a5c3f4b1d34314a79290f9ef4d to your computer and use it in GitHub Desktop.
Delete all unsed node deps
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| file='unused-deps.txt' | |
| echo "list all unused deps" | |
| npx depcheck > $file | |
| n=1 | |
| while read line; do | |
| dep=$( echo "$line" | cut -c 3- ) | |
| echo "uninstall : $dep" | |
| npm uninstall "$dep" | |
| n=$((n+1)) | |
| done < $file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment