Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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')

This comment has been minimized.

Copy link
Owner Author

@xx4159 xx4159 commented Jan 10, 2020

npm view <name> version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment