Skip to content

Instantly share code, notes, and snippets.

@florianpasteur
Created June 23, 2023 10:01
Show Gist options
  • Save florianpasteur/606d95b1dc45507bc311567d77aa67a5 to your computer and use it in GitHub Desktop.
Save florianpasteur/606d95b1dc45507bc311567d77aa67a5 to your computer and use it in GitHub Desktop.
Simple & straight forward dependecy check for npm projects
# Do not use project root folder as it would catch the package.json file
SRC_LOCATION=apps
PACKAGE_JSON_LOCATION=package.json
for dep in $(jq -r '.dependencies | keys[]' $PACKAGE_JSON_LOCATION)
do
if grep -R -m 1 $dep $SRC_LOCATION > /dev/null;
then
echo "✅ " $dep
else
echo "❌ " $dep
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment