use npm package.json version in script code example Example: npm get package.json version node -pe "require('./package.json')['version']"