Home >Web Front-end >JS Tutorial >Npm Check and Update/Delete Package If Needed

Npm Check and Update/Delete Package If Needed

DDD
DDDOriginal
2024-11-29 11:31:10265browse

As for dealing with sticking up to date dependencies in our projects one approach is npm outdated command, that will display a list of installed packages with their current version and the latest available version.

Npm Check and Update/Delete Package If Needed

In order to update your dependencies listed in package.json one can use npm update command.

In this post I want you introduce much more powerful tool called npm-check-extras - CLI app to check for outdated and unused dependencies, and run update/delete action over selected ones.
In order to use it you can install it globally using

$ npm install -g npm-check-extras

or execute it by using npx:

npx npm-check-extras

and then you will have a UI to interactively update/delete packages with plenty of additional options. Main feature of course is update/delete packages with possibilities to toggle target packages desired to be actioned about. You can select packages by specifying a filter query.

As you can see there are many options you can use: targeting only development dependencies, looking at global packages, etc. One option you could find handy is storing a history of actions and viewing it so you can monitor and analyze what packages were updated/deleted while working on a project.
<script></script> <script></script>

The above is the detailed content of Npm Check and Update/Delete Package If Needed. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:Enterprise Mobile AppsNext article:Enterprise Mobile Apps