Skip to content

Instantly share code, notes, and snippets.

View cmferreira-352's full-sized avatar

Cristhian Ferreira cmferreira-352

View GitHub Profile
@cmferreira-352
cmferreira-352 / get-npm-package-version
Created January 6, 2020 19:42 — forked from DarrenN/get-npm-package-version
Extract version from package.json (NPM) using bash / shell
# 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