deps-dev
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLatest Package Version Lookup
最新包版本查询
Query the deps.dev API to get the latest stable version of open source packages.
通过查询deps.dev API获取开源包的最新稳定版本。
Supported Ecosystems
支持的生态系统
| Ecosystem | System ID | Example Package |
|---|---|---|
| npm | | |
| PyPI | | |
| Go | | |
| Cargo | | |
| Maven | | |
| NuGet | | |
| 生态系统 | 系统ID | 示例包 |
|---|---|---|
| npm | | |
| PyPI | | |
| Go | | |
| Cargo | | |
| Maven | | |
| NuGet | | |
Workflow
工作流程
Think step-by-step:
-
Identify the ecosystem from context:
- or
package.json→ npmnode_modules - ,
requirements.txt,pyproject.toml→ pypisetup.py - ,
go.mod→ gogo.sum - → cargo
Cargo.toml - ,
pom.xml→ mavenbuild.gradle - ,
*.csproj→ nugetpackages.config - If unclear, ask the user
-
Run the get-versions script:
bash
SCRIPT=scripts/get-versions.py
python3 $SCRIPT <system> <pkg1> [pkg2] ...- Report the results from the JSON output
按步骤操作:
-
从上下文识别生态系统:
- 或
package.json→ npmnode_modules - 、
requirements.txt、pyproject.toml→ pypisetup.py - 、
go.mod→ gogo.sum - → cargo
Cargo.toml - 、
pom.xml→ mavenbuild.gradle - 、
*.csproj→ nugetpackages.config - 如果不明确,询问用户
-
运行get-versions脚本:
bash
SCRIPT=scripts/get-versions.py
python3 $SCRIPT <system> <pkg1> [pkg2] ...- 报告JSON输出的结果
Script Usage
脚本使用方法
Single package:
bash
python3 scripts/get-versions.py npm expressMultiple packages:
bash
python3 scripts/get-versions.py npm express lodash @types/nodeDifferent ecosystems:
bash
python3 scripts/get-versions.py pypi requests django flask
python3 scripts/get-versions.py go github.com/gin-gonic/gin
python3 scripts/get-versions.py maven org.springframework:spring-core单个包:
bash
python3 scripts/get-versions.py npm express多个包:
bash
python3 scripts/get-versions.py npm express lodash @types/node不同生态系统:
bash
python3 scripts/get-versions.py pypi requests django flask
python3 scripts/get-versions.py go github.com/gin-gonic/gin
python3 scripts/get-versions.py maven org.springframework:spring-coreOutput Format
输出格式
The script outputs JSON with the following structure:
json
{
"system": "npm",
"packages": [
{
"package": "express",
"version": "5.0.0",
"publishedAt": "2024-09-10T04:40:34Z",
"isDeprecated": false
},
{
"package": "lodash",
"version": "4.17.21",
"publishedAt": "2021-02-20T15:42:16Z",
"isDeprecated": false
}
]
}Error response:
json
{
"system": "npm",
"packages": [
{
"package": "nonexistent-pkg",
"error": "HTTP 404: Not Found"
}
]
}脚本会输出如下结构的JSON:
json
{
"system": "npm",
"packages": [
{
"package": "express",
"version": "5.0.0",
"publishedAt": "2024-09-10T04:40:34Z",
"isDeprecated": false
},
{
"package": "lodash",
"version": "4.17.21",
"publishedAt": "2021-02-20T15:42:16Z",
"isDeprecated": false
}
]
}错误响应:
json
{
"system": "npm",
"packages": [
{
"package": "nonexistent-pkg",
"error": "HTTP 404: Not Found"
}
]
}Error Handling
错误处理
- HTTP 404: Package not found - check spelling and ecosystem
- Network error: deps.dev API may be temporarily unavailable
- No default version: Script returns the latest available version with a note
- HTTP 404:未找到包 - 检查拼写和生态系统
- 网络错误:deps.dev API可能暂时不可用
- 无默认版本:脚本会返回最新可用版本并附带说明
Rules
规则
- Always use the script instead of manual curl commands
- The script handles URL encoding automatically
- Multiple packages are fetched in parallel for efficiency
- Use field to warn users about deprecated packages
isDeprecated
- 始终使用脚本而非手动curl命令
- 脚本会自动处理URL编码
- 多个包会并行获取以提高效率
- 使用字段提醒用户注意已弃用的包
isDeprecated