Skip to content

Instantly share code, notes, and snippets.

@slonoed
Last active May 31, 2019 13:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slonoed/321302b9ebe5728531a4fabcbb907d08 to your computer and use it in GitHub Desktop.
Save slonoed/321302b9ebe5728531a4fabcbb907d08 to your computer and use it in GitHub Desktop.
Find unused deps
FILES=$(cat package.json | jq -r '.dependencies * .devDependencies | keys | join("\n")')
ARR=', ' read -r -a array <<< $FILES
echo Not found deps
echo
for dep in "${array[@]}"
do
grep -qr "$dep" src
if [ $? -eq 1 ]; then
echo $dep
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment