Created
March 15, 2019 15:30
-
-
Save Powell-v2/c3feffcac834d1c94a8898c9c4abdf29 to your computer and use it in GitHub Desktop.
Checks whether deps listed in package.json are in actual use and suggests removing those that are not used directly.
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
for dep in $(jq -r ".dependencies | keys | .[]" package.json); do | |
if ! grep "from .*$dep.*" -Rq --exclude-dir="node_modules" .; then | |
echo "you can probably remove $dep" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment