Skip to content

Instantly share code, notes, and snippets.

View calebjeffrey's full-sized avatar

Caleb Jeffrey calebjeffrey

  • Nike
  • Portland, OR
View GitHub Profile
@calebjeffrey
calebjeffrey / get-npm-package-version
Created June 23, 2018 15:59 — forked from yvele/get-npm-package-version.sh
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' \
| tr -d '[[:space:]]')
echo $PACKAGE_VERSION