NPM Dependencies Updater
Smart version management for package.json with one-click updates and breaking change detection.

✨ Features
- 🔍 Smart Version Detection - Automatically scans
package.json files and displays real-time version status.
- 🎯 Risk Analysis - Distinguishes between safe updates (patch/minor) and risky updates (major versions) with clear icons.
- 🖱️ One-Click Updates - Click on CodeLens hints to update your dependencies instantly.
- ⚠️ Safety Confirmation - Intelligent modal dialogs when performing batch updates to handle major version risks.
- 📊 Status Bar Integration - Real-time summary of available updates in your VS Code status bar.
- 🌍 Multi-language Support - Full support for English and Chinese.
- 💾 Smart Caching - Efficiently caches NPM registry data to ensure a smooth, non-blocking experience.
- 🔗 NPM Integration - Quick links to view package details on npmjs.com.
🚀 Installation
- Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Search for "NPM Dependencies Updater"
- Click Install
Or install from command line:
code --install-extension cookabc.npm-dependencies-updater
🚀 Usage
- Open any
package.json file.
- The extension automatically shows status for each dependency:
✓ Up to date - Package is already at the latest version.
$(sync~spin) Checking... - Fetching information from NPM.
$(arrow-up) Update to X.X.X - Safe update available (click to update).
$(warning) Update to X.X.X Major - Major version update (use caution).
- Use the Status Bar summary to see an overview of your project's health.
- Click "Update All" in the status bar or command palette to batch update safe packages.
⚙️ Configuration
| Setting |
Default |
Description |
npmDeps.enabled |
true |
Enable/disable the extension |
npmDeps.showPrerelease |
false |
Include pre-release versions |
npmDeps.cacheTTLMinutes |
60 |
Cache TTL in minutes |
npmDeps.registryUrl |
https://registry.npmjs.org |
Custom NPM registry URL |
🏗️ Project Structure
src/
├── core/ # Core business logic
│ ├── cache.ts # Cache management
│ ├── packageJsonParser.ts # package.json parsing
│ └── versionResolver.ts # Version risk analysis & resolution
├── providers/ # Service providers
│ ├── codeLensProvider.ts # CodeLens provider
│ ├── npmClient.ts # NPM API client
│ └── versionService.ts # Version service
├── utils/ # Utility functions
│ └── statusBar.ts # Status bar management
├── types/ # Type definitions
│ └── index.ts
└── extension.ts # Extension entry point
🛠️ Development
# Install dependencies
npm install
# Compile
npm run compile
# Run tests
npm test
📄 License
MIT License. See LICENSE for details.
| |