In this article, I’ll discuss some of the less known npm commands that I use the most.
Often I find myself wondering what npm packages I have globally installed on a machine. The command to find the name of the globally installed packages and their version is the following:
npm list -g --depth=0
When working on a new project, you may try different packages before choosing the one that works best for you. So, you might end up having your node_modules folder filled with packages (and their dependencies) that you aren’t using anymore. To clean up the node_modules folder and claim some space back, you can use the command:
Any project that is under development for more than a week will eventually use a version of one or more packages that isn’t up to date. To check if there are newer versions of the packages declared in your package.json file, you can run the command:
The result will be something like this:
The npm client is the first and most used client available for the npm registry. In addition to the usual
test, the npm client offers many other interesting commands. In this article, I’ve introduced you to some of the less known npm commands that I find very useful, that is