How to use npm-check-updates
What is npm-check-updates?
npm-check-updates makes it easy to upgrade your library based on CUI.
With this library, you can make only major updates or only minor updates.
I will explain how to use it in detail from the next section.
How to use
First, install npm-check-updates in your environment.
$ npm i -g npm-check-updates
After installation, you will be able to use the following commands.
$ ncu
execute that command, the following result will be output to CUI.
What does each color mean?
Red = major upgrade (and all major version zero)
Cyan = minor upgrade
Green = patch upgrade
If you run the ncu command without any options, a major update will occur.
So, if you only want to do patch updates, run the ncu command with the following options:
$ ncu -u --target patch
The execution result is here.
I also tried running a minor update command
$ ncu -u --target minor
I’m seeing some red messages, but this doesn’t seem to be a major upgrade.
Conclusion
I often get notified of vulnerabilities on npm, so I’m very grateful to be able to upgrade easily.