Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
"Fail faster"

Daniel Vivar jdvivar

💭
"Fail faster"
View GitHub Profile
@DarrenN
DarrenN / get-npm-package-version
Last active Nov 23, 2021 — forked from yvele/get-npm-package-version
Extract version from package.json (NPM) using bash / shell
View get-npm-package-version
# Version key/value should be on his own line
PACKAGE_VERSION=$(cat package.json \
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g')
echo $PACKAGE_VERSION