The npm Dependencies Check is a Visual Studio Code extension that automatically monitors the package.json file within your workspace. It notifies you whenever the installed packages in the node_modules folder are out of sync with the dependencies listed in the package.json file. This helps you ensure that your project's dependencies are up to date and accurately reflect the specified versions.
Features
Watches the package.json file for changes and updates.
Compares the installed packages in the node_modules folder with the dependencies specified in the package.json file.
Provides real-time notifications when inconsistencies are detected.
Supports multiple workspaces, allowing you to monitor different projects simultaneously.
Installation
Launch Visual Studio Code.
Go to the Extensions view by clicking on the square icon on the sidebar or pressing Ctrl+Shift+X.
Search for "npm Dependencies Check" in the Extensions search bar.
Click on the extension in the search results.
Click the "Install" button to install the extension.
Once the installation is complete, the extension will be activated automatically.
Usage
Open your project in Visual Studio Code.
Ensure that you have a package.json file present in the root of your workspace.
The extension will automatically start monitoring the package.json file and the installed packages in the node_modules folder.
Whenever a discrepancy is detected, a notification will appear in the lower-right corner of the editor.
Click on the notification to resolve the inconsistencies by updating your dependencies accordingly.
Alternatively you can also use command npm Dependencies Check: Check dependencies to manualy invoke dependencies check.
Configuration
The extension provides a few configuration options that you can modify to suit your preferences. To access the extension's settings:
Click on the gear icon in the lower-left corner of the sidebar to open the Settings pane.
Click on the Extensions category.
Locate and click on the npm Dependencies Check extension.
The following configuration options are available:
Install command: Specifies command that will be run to sync dependencies in your project.
License
This extension is licensed under the MIT License. Feel free to modify and distribute it as needed.