npm version “scripts have access to the new version in package.json”
问题 The doco for npm version is at https://docs.npmjs.com/cli/version. It says (my emphasis): Run the version script. These scripts have access to the new version in package.json (so they can incorporate it into file headers in generated files for example) . Again, scripts should explicitly add generated files to the commit using git add. How do you get this version from package.json. With a combination of grep, tr, .. shell commands or in a variable? I tried %s that is used for the git tag and