Skip to content

Instantly share code, notes, and snippets.

View Sylvain-Bugat's full-sized avatar
🏭

Sylvain Bugat Sylvain-Bugat

🏭
View GitHub Profile
@Sylvain-Bugat
Sylvain-Bugat / get-npm-package-version
Last active April 14, 2017 20:19 — forked from yvele/get-npm-package-version.sh
Extract version from package.json (NPM) using bash / shell / awk
# One command version using awk
PACKAGE_VERSION=$( awk -F: '$1 ~ /"version"/ { split($2,array,"\""); print array[2] ; exit }' package.json )
echo "${PACKAGE_VERSION}"