package version in package.json code example
Example 1: npm get package.json version
node -pe "require('./package.json')['version']"
Example 2: package.json version
$(node -pe 'require(\"./package.json\")[\"version\"]')
node -pe "require('./package.json')['version']"
$(node -pe 'require(\"./package.json\")[\"version\"]')