npm-interactive-check
v1.0.2
Published
Interactive npm dependency updater with changelog previews and breaking change warnings
Downloads
114
Maintainers
Readme
npm-interactive-check
Interactive npm dependency updater with changelog previews and breaking change warnings.
Features
- Interactive Updates: Review and select packages to update one by one or from a list
- Changelog Preview: Automatically fetches changelogs from GitHub releases or CHANGELOG.md files
- Breaking Change Detection: Highlights major version updates with clear warnings
- Semver-Aware: Distinguishes between major, minor, and patch updates
- Multiple Update Modes: Choose between interactive review, selection list, or update all
- Beautiful CLI: Clean, colorful output with progress indicators
Installation
# Global installation (recommended)
npm install -g npm-interactive-check
# Or run directly with npx (no installation needed)
npx npm-interactive-checkNote for Windows users: After global installation, you may need to restart your terminal for the command to be recognized. See Troubleshooting if you encounter any issues.
Usage
# Run interactive update check
npm-interactive-check
# Or use the short alias
nicOptions
| Option | Description |
|--------|-------------|
| -a, --all | Update all packages without prompting |
| -d, --dev | Only check devDependenices |
| -p, --prod | Only check dependenices (exclude devDependenices) |
| -g, --global | Check globally installed packages |
| -i, --interactive | Review each package individually (default) |
| --json | Output results as JSON |
| --depth <n> | Max depth for checking nested dependenices |
| --registry <url> | Use a custom npm registry |
| --debug | Enable debug logging |
Examples
# Check and interactively update all outdated packages
nic
# Only check dev dependenices
nic --dev
# Check global packages
nic --global
# Update all packages (no prompts)
nic --all
# Output as JSON for scripting
nic --jsonUpdate Modes
When you run npm-interactive-check, you'll be prompted to choose an update mode:
- Review each package individually: Go through each outdated package one by one, view changelogs, and decide whether to update
- Select from list: View all outdated packages and select which ones to update using checkboxes
- Update all: Update all packages to their latest versions (use with caution)
Breaking Change Warnings
Packages with major version updates are highlighted with a red warning badge. When a breaking change is detected:
- The package is marked with
⚠ BREAKING - Changelog is automatically fetched and displayed
- You'll be prompted to confirm before proceeding
Programmatic Usage
import {
getOutdatedPackages,
fetchChangelog,
updatePackages,
determineUpdateType,
} from 'npm-interactive-check';
// Get all outdated packages
const packages = await getOutdatedPackages();
// Fetch changelog for a specific package
const changelog = await fetchChangelog(packages[0]);
// Check update type
const updateType = determineUpdateType('1.0.0', '2.0.0'); // 'major'Requirements
- Node.js >= 18.0.0
- npm (any recent version)
Troubleshooting
Windows: Command not recognized
If you see the error 'npm-interactive-check' is not recognized as an internal or external command, try these solutions:
Ensure the package is installed globally:
npm install -g npm-interactive-checkRestart your terminal/command prompt after installation to refresh PATH variables
Use npx instead:
npx npm-interactive-checkCheck if npm's global bin directory is in your PATH:
npm config get prefixThe output directory's
binfolder (or on Windows: the directory itself) should be in your system PATH.On Windows, this is typically:
%APPDATA%\npmTo add it to PATH:
- Open System Properties → Advanced → Environment Variables
- Edit the
Pathvariable under "User variables" - Add the npm global directory (e.g.,
C:\Users\YourName\AppData\Roaming\npm) - Restart your terminal
Verify installation:
npm list -g npm-interactive-check
Permission Issues
If you encounter permission errors during installation on Linux/macOS:
sudo npm install -g npm-interactive-checkOr configure npm to use a different directory:
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
export PATH=~/.npm-global/bin:$PATHDevelopment
# Clone the repository
git clone https://github.com/MDevSolutions/npm-interactive-check.git
cd npm-interactive-check
# Install dependenices
npm install
# Run in development mode
npm run dev
# Run tests
npm test
# Run linter
npm run lint
# Build for production
npm run buildContributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes using conventional commits (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Commit Convention
This project uses Conventional Commits for automated versioning and changelog generation:
feat:- A new feature (triggers minor release)fix:- A bug fix (triggers patch release)docs:- Documentation changeschore:- Maintenance tasksBREAKING CHANGE:- Breaking changes (triggers major release)
License
MIT
