deps-dev

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Latest Package Version Lookup

最新包版本查询

Query the deps.dev API to get the latest stable version of open source packages.
通过查询deps.dev API获取开源包的最新稳定版本。

Supported Ecosystems

支持的生态系统

EcosystemSystem IDExample Package
npm
npm
express
,
@types/node
PyPI
pypi
requests
,
django
Go
go
github.com/gin-gonic/gin
Cargo
cargo
serde
,
tokio
Maven
maven
org.springframework:spring-core
NuGet
nuget
Newtonsoft.Json
生态系统系统ID示例包
npm
npm
express
,
@types/node
PyPI
pypi
requests
,
django
Go
go
github.com/gin-gonic/gin
Cargo
cargo
serde
,
tokio
Maven
maven
org.springframework:spring-core
NuGet
nuget
Newtonsoft.Json

Workflow

工作流程

Think step-by-step:
  1. Identify the ecosystem from context:
    • package.json
      or
      node_modules
      → npm
    • requirements.txt
      ,
      pyproject.toml
      ,
      setup.py
      → pypi
    • go.mod
      ,
      go.sum
      → go
    • Cargo.toml
      → cargo
    • pom.xml
      ,
      build.gradle
      → maven
    • *.csproj
      ,
      packages.config
      → nuget
    • If unclear, ask the user
  2. Run the get-versions script:
bash
SCRIPT=scripts/get-versions.py
python3 $SCRIPT <system> <pkg1> [pkg2] ...
  1. Report the results from the JSON output
按步骤操作:
  1. 从上下文识别生态系统
    • package.json
      node_modules
      → npm
    • requirements.txt
      pyproject.toml
      setup.py
      → pypi
    • go.mod
      go.sum
      → go
    • Cargo.toml
      → cargo
    • pom.xml
      build.gradle
      → maven
    • *.csproj
      packages.config
      → nuget
    • 如果不明确,询问用户
  2. 运行get-versions脚本
bash
SCRIPT=scripts/get-versions.py
python3 $SCRIPT <system> <pkg1> [pkg2] ...
  1. 报告JSON输出的结果

Script Usage

脚本使用方法

Single package:
bash
python3 scripts/get-versions.py npm express
Multiple packages:
bash
python3 scripts/get-versions.py npm express lodash @types/node
Different 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-core

Output 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
    isDeprecated
    field to warn users about deprecated packages
  • 始终使用脚本而非手动curl命令
  • 脚本会自动处理URL编码
  • 多个包会并行获取以提高效率
  • 使用
    isDeprecated
    字段提醒用户注意已弃用的包