Created
January 31, 2015 12:25
-
-
Save ivan-kleshnin/d8e14faffaafe36bfaca to your computer and use it in GitHub Desktop.
Check npm package is installed
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
function npm_package_is_installed { | |
if [ $(npm list --depth 0 --parseable true "${2}" | grep "${1}$") ]; then | |
echo "1" | |
else | |
echo "0" | |
fi | |
} | |
# npm_package_is_installed gulp | |
# npm_package_is_installed gulp -g |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment