@chatie/semver

中文文档
0.6.0发布于 2025/04/29Apache-2.0TypeScriptCommonJS近 30 天下载 3185

The Enhanced Semantic Versioner for NPM

原始使用文档
文档目录9 节
  1. USAGE
  2. BACKGROUND
  3. CHANGELOG
  4. v0.6 (master, 2025-04)
  5. v0.3 Oct 2021
  6. v0.2 June 09, 2019
  7. v0.0.1 June 08, 2019
  8. AUTHOR
  9. COPYRIGHT & LICENSE

@chatie/semver

NPM Version npm (tag) Build Status

Linux Kernel Numbering

Source: How do Linux Versions Work?

The Enhanced Semantic Versioner for NPM

USAGE

This module is a wrapper of the NPM module semver, it provide following additional features:

  1. Two CLI utils that will identify whether this VERSION is for production(stable) or development(unstable):
    1. semver-is-prod
    2. semver-id-dev
  2. Added two methods to SemVer class:
    1. isProd(version: string): boolean
    2. isDev(version: string): boolean
  3. TypeScript support. It contains the typing definations already

Learn more about the original semver from its GitHub homepage: semver

BACKGROUND

Copy from Linux Kernel Version Numbering - http://www.linfo.org/kernel_version_numbering.html:

The second number denotes the major revision of the kernel version. It was formerly the case that even numbers indicated a stable release, that is, one that was deemed fit for production use (i.e., use in a non-experimental environment), such as 1.2, 2.4 or 2.6. Likewise, odd numbers, such as 1.1 or 2.5, have historically represented development releases. They were for testing new features and device drivers until they became sufficiently stable to be included in a stable release. However, this has changed starting with the Linux 2.6.x series, and new feature development now takes place in the same revision number.

Following the Semantic Versioning 2.0 http://semver.org/, and we will be able to use the MINOR version to indicated the release is STABLE or NOT.

Numbering rule:

  1. even numbers, such as 0.8, 0.12 indicated a stable release, which is fit for production use.
  2. odd numbers, such as 0.11 or 0.13, represented as development releases.

See also: https://github.com/Chatie/wechaty/issues/905

CHANGELOG

v0.6 (master, 2025-04)

  1. identify 2.0.0-alpha.1 as isDev

v0.3 Oct 2021

  1. remove binary semver-is-dev because it might introduce bugs when using in devops. Use semver-is-prod instead.

v0.2 June 09, 2019

  1. Beta Release

v0.0.1 June 08, 2019

  1. Wrap semver
  2. add new methods: isProd & isDev
  3. add new binary: semver-is-prod & semver-is-dev

AUTHOR

Huan LI (李卓桓) [email protected]

Profile of Huan LI (李卓桓) on StackOverflow

  • Code & Docs © 2019 - now Huan LI [email protected]
  • Code released under the Apache-2.0 License
  • Docs released under Creative Commons

版本与发布记录

@chatie/semver 共发布 14 个版本,首次发布于 2019/06/08;过去 12 个月发布了 0 个版本。

版本发布日期距今
0.6.0latest2025/04/291.5 年前
0.4.72019/06/107 年前
0.4.62019/06/107 年前
0.4.52019/06/107 年前
0.4.22019/06/087 年前
0.3.5next2019/06/087 年前

关于 @chatie/semver 的常见问题

@chatie/semver 是什么?

The Enhanced Semantic Versioner for NPM

如何安装 @chatie/semver?

在项目目录运行 npm install @chatie/semver,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 semver-is-prod,可以用 npx semver-is-prod 直接运行。

@chatie/semver 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@chatie/semver 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@chatie/semver 可以商用吗?

@chatie/semver 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@chatie/semver 的下载量有多少?

根据 npm 官方下载统计,@chatie/semver 在 2026/10/10 – 2026/11/08 这 30 天内被下载 3,185 次,日均约 106 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@chatie/semver 还在维护吗?

最新版本 0.6.0 发布于 2025/04/29(1.5 年前);至今共发布 14 个版本,其中过去 12 个月发布了 0 个;首次发布于 2019/06/08。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。