Skip to content

Instantly share code, notes, and snippets.

@slonoed
Last active May 31, 2019
Embed
What would you like to do?
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