Created
March 28, 2017 09:20
-
-
Save thibmaek/b786c21a867f61c91cb9ab811c8a3480 to your computer and use it in GitHub Desktop.
Get node engine from package.json
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
# Given engine.node = 6.10.1 in package.json | |
# will output 6.10.1 in the shell | |
cat package.json | grep \"node\": | grep -E -o '(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)' | |
# Why? Auto install package.json version to nvm | |
cat package.json | grep \"node\": | grep -E -o '(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)' | nvm install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment