DEV Community

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

Posted on

3 1 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.

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay