New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

update-modules

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

update-modules

Advanced module updater with backup, security audit, and reporting features

latest
Source
npmnpm
Version
0.3.1
Version published
Maintainers
1
Created
Source

🚀 update-modules

A comprehensive, enterprise-grade module updater with advanced features including backup/restore, security audits, selective updates, and intelligent update strategies. Keep your projects up-to-date effortlessly with fine-grained control over the update process.

✨ Features

  • 🔄 Smart Update Strategies - Patch, minor, or major update strategies
  • 🎯 Selective Updates - Update only specific modules or exclude certain ones
  • 💾 Backup & Restore - Automatic backup of package-lock.json with restore capability
  • 🔒 Security Audits - Built-in npm audit integration for vulnerability checks
  • 📊 Detailed Reports - Generate update reports in JSON or text format
  • 🎛️ Interactive Mode - Choose which modules to update individually
  • ⚙️ Configuration File - Project-specific settings via .updaterc.json
  • 🤖 CI/CD Ready - Silent mode perfect for automated environments
  • 🧹 Cache Management - Advanced cleanup options for node_modules and lock files
  • 📋 Dry Run Mode - See what would be updated without making changes

📦 Installation

Local Installation

npm install update-modules@latest

Global Installation

npm install -g update-modules@latest

Add to package.json

{
  "scripts": {
    "update-modules": "update-modules"
  }
}

🎯 Usage

Basic Operations

# Check and update all modules
update-modules

# Dry run - see what would be updated
update-modules --dry-run

# Interactive mode - choose modules individually
update-modules --interactive

# Silent mode for CI/CD
update-modules --ci

Update Strategies

# Only patch updates (1.0.0 → 1.0.1)
update-modules --strategy=patch

# Patch and minor updates (1.0.0 → 1.1.0)
update-modules --strategy=minor

# All updates including major (1.0.0 → 2.0.0) - default
update-modules --strategy=major

Selective Updates

# Update only specific modules
update-modules --only=express,lodash,moment

# Exclude specific modules
update-modules --exclude=react,vue,angular

# Update only development dependencies
update-modules --dev-only

# Update only production dependencies
update-modules --prod-only

Backup & Restore

# Create backup of package-lock.json
update-modules --backup

# Restore from backup (interactive selection)
update-modules --restore

# List available backups
update-modules --list-backups

Security & Audits

# Run security vulnerability check
update-modules --security

# Run npm audit
update-modules --audit

# Combine with updates
update-modules --security --strategy=patch

Reports & Export

# Generate update report
update-modules --report

# Export report in specific format
update-modules --export=json
update-modules --export=txt

# Combine with dry run for planning
update-modules --dry-run --export=json

Cache Management

# Clear both node_modules and package-lock.json
update-modules -clear

# Clear only node_modules
update-modules -clear node_modules

# Clear only package-lock.json
update-modules -clear package-lock.json

Advanced Usage

# Combined operations
update-modules --strategy=minor --backup --interactive --report

# CI/CD pipeline
update-modules --ci --strategy=patch --export=json

# Development workflow
update-modules --dev-only --interactive --backup

⚙️ Configuration

Create a .updaterc.json file in your project root for custom settings:

{
  "ignore": ["update-modules", "legacy-module"],
  "autoUpdate": false,
  "updateStrategy": "minor",
  "clearBeforeUpdate": false,
  "backupPackageLock": true,
  "maxBackups": 10
}

Configuration Options

OptionTypeDefaultDescription
ignoreArray[]Modules to ignore during updates
autoUpdateBooleanfalseSkip confirmation prompts
updateStrategyString"major"Default update strategy (patch, minor, major)
clearBeforeUpdateBooleanfalseClear cache before updating
backupPackageLockBooleantrueAutomatically backup package-lock.json
maxBackupsNumber10Maximum number of backups to keep

🚀 CLI Reference

Main Commands

update-modules [options]

Options

Basic Operations

  • --help, -h - Show help message
  • --debug - Enable debug mode with verbose output
  • --dry-run - Show what would be updated without making changes
  • --interactive - Interactive mode for selecting modules
  • --ci - Silent mode for CI/CD environments

Update Strategies

  • --strategy=patch - Only patch updates
  • --strategy=minor - Patch and minor updates
  • --strategy=major - All updates (default)

Selective Updates

  • --only=module1,module2 - Update only specified modules
  • --exclude=module1,module2 - Exclude specified modules from updates
  • --dev-only - Update only devDependencies
  • --prod-only - Update only dependencies

Backup Operations

  • --backup - Create backup of package-lock.json
  • --restore - Restore from backup interactively
  • --list-backups - List all available backups

Security & Reports

  • --security - Run security vulnerability check
  • --audit - Run npm audit
  • --report - Generate update report
  • --export=format - Export report (json, txt)

Cache Management

  • -clear - Clear node_modules and package-lock.json
  • -clear node_modules - Clear only node_modules
  • -clear package-lock.json - Clear only package-lock.json

💡 Examples

Development Workflow

# 1. Check for updates with backup
update-modules --backup --dry-run --report

# 2. Update only patch versions interactively
update-modules --strategy=patch --interactive

# 3. Update dev dependencies only
update-modules --dev-only --strategy=minor

Production Deployment

# 1. Security audit before update
update-modules --security --audit

# 2. Safe production update
update-modules --strategy=patch --backup --ci

# 3. Generate deployment report
update-modules --dry-run --export=json

Emergency Recovery

# 1. List available backups
update-modules --list-backups

# 2. Restore from backup
update-modules --restore

# 3. Clear corrupted cache
update-modules -clear

📋 Changelog

v0.2.0 - Major Feature Release

  • ✨ Added intelligent update strategies (patch, minor, major)
  • ✨ Implemented backup and restore functionality
  • ✨ Added selective update options (--only, --exclude, --dev-only, --prod-only)
  • ✨ Integrated security audit capabilities
  • ✨ Added comprehensive reporting system
  • ✨ Implemented interactive mode for granular control
  • ✨ Added configuration file support (.updaterc.json)
  • ✨ Enhanced CI/CD integration with silent mode
  • ✨ Added dry-run mode for safe testing
  • 🐛 Improved error handling and user feedback
  • 📚 Comprehensive documentation and examples

View previous changes from commits.

📄 License

MIT License

📞 Contact

If you have any feedback, contribution, bug report or suggestion, please feel free to contact me@cihatksm.com.

Made with ❤️ by cihatksm

🤖 Acknowledgments

This project was developed with assistance from GitHub Copilot AI

Keywords

cihatksm

FAQs

Package last updated on 02 Oct 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts