Created
January 8, 2016 07:16
-
-
Save zzarcon/c0e367756611cd5518a6 to your computer and use it in GitHub Desktop.
Show the version of any npm package from command line
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
moduleVersion() { | |
str=`cat $1/package.json | grep -i '"version"'` | |
echo $str | |
} |
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
$ moduleVersion node_modules/ember-cli | |
Outputs: | |
"version": "2.2.0-beta.1", | |
^^ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment