Before I do a small release and tag it, I\'d like to update the package.json to reflect the new version of the program.
Is there a way to edit the file package
To give a more up-to-date approach.
package.json "scripts": {
"eslint": "eslint index.js",
"pretest": "npm install",
"test": "npm run eslint",
"preversion": "npm run test",
"version": "",
"postversion": "git push && git push --tags && npm publish"
}
Then you run it:
npm version minor --force -m "Some message to commit"
Which will:
... run tests ...
change your package.json to a next minor version (e.g: 1.8.1 to 1.9.0)
push your changes
create a new git tag release and
publish your npm package.
--force is to show who is the boss! Jokes aside see https://github.com/npm/npm/issues/8620