Skip to content

Instantly share code, notes, and snippets.

@pietvanzoen
Last active November 10, 2017 13:39
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 pietvanzoen/af80492f2925f362458428b1a1234a18 to your computer and use it in GitHub Desktop.
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.
#!/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