Last active
November 10, 2017 13:39
-
-
Save pietvanzoen/af80492f2925f362458428b1a1234a18 to your computer and use it in GitHub Desktop.
Create a list of all production dependency npm urls for the current node project.
This file contains 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 | |
# Returns a list of all unique production dependencies for the current node project. | |
if [[ ! -f package.json ]]; then | |
echo "Not a node project" | |
exit 1 | |
fi | |
npm list --prod | | |
head -n -2 | | |
tail -n +2 | | |
grep -v "UNMET DEPENDENCY" | | |
sed 's/^[^a-zA-Z@]*\(.*\)@[0-9].*$/\1/' | | |
sort | | |
uniq |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment