How do I get the current version from package.json using npm
?
I know that npm version
will output my package's version along with npm and other dependencies. But I need a short command to get only my package version to use on a CI. So ideally, no extra input as the CI doesn't know what project it's dealing with.
npm version from-git --allow-same-version
would also work, if it didn't try to tag the new version on Git.