展开 npm 语义化版本范围并检查版本

GET/semver

按 npm 使用的 node-semver 严格模式解析范围,返回规范化比较器、能满足范围的最低版本,以及每个版本是否满足、满足的最高和最低版本与降序排序。预发布版本默认只在范围写明同一 major.minor.patch 的预发布时才满足。无效版本的 version 与 satisfies 为 null。

访问公开(可选 Bearer)路径兼容GET /semver/{range}CLI 默认text/plain

请求参数

rangequery · 字符串必填

npm 风格范围:^、~、x 通配、a - b,空格表示 AND,|| 表示 OR,* 表示任意正式版本。

长度:1 ~ 256 字符路径简写:/semver/{range}示例:^1.2.3
versionsquery · 字符串

待检查的版本,逗号或空白分隔,最多 100 个。

默认:最长:4096 字符示例:1.2.3,1.4.0,1.5.0-beta.1,2.0.0
includePrereleasequery · 字符串

true 时预发布版本也按普通版本比较,对应 node-semver 的 includePrerelease。

默认:false可选:true | false
通用输出参数_format_color展开
_formatquery · 字符串

响应格式:json 或 text(plain 为 text 别名)。

可选:json | text
_colorquery · 字符串

0、false、off 或 no 关闭 ANSI 颜色。

可选:0 | false | off | no

响应体

range字符串
normalized字符串
sets字符串数组数组
includePrerelease布尔值
minVersion字符串 | null
versions对象数组
input字符串
version字符串 | null
satisfies布尔值 | null
maxSatisfying字符串 | null
minSatisfying字符串 | null
sorted字符串数组