CLI 工具,用于检查 package.json、requirements.txt、pyproject.toml 等包文件中的过时依赖。
A CLI tool that checks for outdated dependencies by running native package manager commands. Currently supports:
package.json dependencies using npm outdatedrequirements.txt using pip list --outdatedpyproject.toml using poetry show --outdated (if poetry is installed)The tool detects which package managers are relevant based on files in the current directory and runs the appropriate checks.
Check dependencies in current directory:
bash
python3 scripts/main.py check
Check specific package manager:
bash
python3 scripts/main.py check --manager npm
python3 scripts/main.py check --manager pip
python3 scripts/main.py check --manager poetry
Output format (JSON):
bash
python3 scripts/main.py check --format json
bash
cd /path/to/project
python3 scripts/main.py check
Output:
text
Checking dependencies...
[✓] Found package.json
[✓] Running npm outdated...
┌─────────────────┬─────────┬─────────┬─────────┬──────────────┐
│ Package │ Current │ Wanted │ Latest │ Package Type │
├─────────────────┼─────────┼─────────┼─────────┼──────────────┤
│ express │ 4.17.1 │ 4.18.0 │ 4.18.0 │ dependencies │
│ lodash │ 4.17.20 │ 4.17.21 │ 4.17.21 │ dependencies │
└─────────────────┴─────────┴─────────┴─────────┴──────────────┘
[✓] Found requirements.txt
[✓] Running pip list --outdated...
┌─────────────────┬─────────┬─────────┐
│ Package │ Current │ Latest │
├─────────────────┼─────────┼─────────┤
│ requests │ 2.28.1 │ 2.31.0 │
│ flask │ 2.2.3 │ 2.3.0 │
└─────────────────┴─────────┴─────────┘
bash
python3 scripts/main.py check --format json
Output:
json
{
"npm": [
{
"package": "express",
"current": "4.17.1",
"wanted": "4.18.0",
"latest": "4.18.0",
"type": "dependencies"
}
],
"pip": [
{
"package": "requests",
"current": "2.28.1",
"latest": "2.31.0"
}
]
}