DEV Community

Cover image for Npm Check and Update/Delete Package If Needed
akgondber
akgondber

Posted on

3 1

Npm Check and Update/Delete Package If Needed

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.

Image description

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
Enter fullscreen mode Exit fullscreen mode

or execute it by using npx:

npx npm-check-extras
Enter fullscreen mode Exit fullscreen mode

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.

demo.gif
view raw demo.gif hosted with ❤ by GitHub

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.

SurveyJS custom survey software

Simplify data collection in your JS app with a fully integrated form management platform. Includes support for custom question types, skip logic, integrated CCS editor, PDF export, real-time analytics & more. Integrates with any backend system, giving you full control over your data and no user limits.

Learn more

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →