Skip to content

Instantly share code, notes, and snippets.

View PYPL-Song's full-sized avatar
🤨
I may be slow to respond.

Song Gie PYPL-Song

🤨
I may be slow to respond.
View GitHub Profile
@PYPL-Song
PYPL-Song / get-npm-package-version
Created January 12, 2023 07:39 — 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