version in npm 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\"]')