Created
March 2, 2015 22:54
-
-
Save glenjamin/aaf9103b9caa6204cf48 to your computer and use it in GitHub Desktop.
What modules am I using?
This file contains hidden or 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
# Run the following in a directory containing npm projects | |
# list all modules being used directly (no sub-dependencies) | |
ls */package.json | xargs -n1 dirname | \ | |
xargs -n1 -I {} bash -c 'cd {} && npm ls --depth=0 2>/dev/null | grep -oiE " [A-Z0-9\-]+@"' | \ | |
cut -d @ -f 1 | sort -u | |
# list all modules being used directly and which project uses them | |
ls */package.json | xargs -n1 dirname | \ | |
xargs -n1 -I {} bash -c 'cd {} && npm ls --depth=0 2>/dev/null | grep -oiE " [A-Z0-9\-]+@" | sed "s/\$/ in {}/"' | \ | |
sort | |
# list all versions of all modules being used directly & which project uses them | |
ls */package.json | xargs -n1 dirname | \ | |
xargs -n1 -I {} bash -c 'cd {} && npm ls --depth=0 2>/dev/null | grep -oiE " [A-Z0-9\-]+@\S+" | sed "s/\$/ in {}/"' | \ | |
sort |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment