npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@itriton/version

v0.0.2

Published

统一的版本管理工具,支持UniApp、UniBest、微信小程序等多种项目类型的版本号更新

Readme

@itriton/version

统一的版本管理工具,支持UniApp、UniBest、微信小程序等多种项目类型的版本号更新。

功能特性

  • 🚀 支持多种项目类型:UniApp、UniBest、微信小程序
  • 🔍 自动检测并更新所有相关文件,不存在的文件会自动跳过
  • 📦 支持语义化版本和日期版本两种versionCode生成模式
  • 🛠️ 统一的CLI接口,易于使用
  • 📝 完整的TypeScript类型支持
  • 🔧 支持自定义版本号

安装

# 全局安装
npm install -g @itriton/version

# 或者使用pnpm
pnpm add -g @itriton/version

# 或者使用yarn
yarn global add @itriton/version

使用方法

方式1:全局安装使用

# 全局安装
npm install -g @itriton/version

# 基本用法
itriton-version patch                    # 补丁版本更新
itriton-version minor                   # 次版本更新  
itriton-version major                   # 主版本更新
itriton-version custom 2.0.0           # 自定义版本号

# 指定versionCode模式
itriton-version patch date             # 使用日期versionCode
itriton-version minor semantic         # 使用语义化versionCode (默认)

方式2:使用npx(推荐)

# 无需安装,直接使用npx
npx @itriton/version patch
npx @itriton/version minor date
npx @itriton/version major
npx @itriton/version custom 2.0.0

方式3:在package.json中配置脚本

{
  "scripts": {
    "update:version": "npx @itriton/version patch",
    "update:version-patch": "npx @itriton/version patch date",
    "update:version-minor": "npx @itriton/version minor date",
    "update:version-major": "npx @itriton/version major date",
    "update:version-custom": "npx @itriton/version custom date"
  }
}

然后运行:

npm run update:version
npm run update:version-patch
npm run update:version-minor
npm run update:version-major
npm run update:version-custom

完整示例

# 次版本更新,日期versionCode
npx @itriton/version minor date

# 自定义版本号,语义化versionCode
npx @itriton/version custom semantic 2.0.0

# 自定义版本号,日期versionCode
npx @itriton/version custom date 2.0.0

# 查看帮助信息
npx @itriton/version --help

参数说明

更新类型

  • major - 主版本号更新 (1.0.0 -> 2.0.0)
  • minor - 次版本号更新 (1.0.0 -> 1.1.0)
  • patch - 补丁版本号更新 (1.0.0 -> 1.0.1)
  • custom - 自定义版本号

versionCode模式

  • semantic - 语义化版本 (基于版本号,默认)
  • date - 日期版本 (年月日时)

versionCode说明

  • 语义化模式: 1.2.3 -> 123
  • 日期模式: 2024年12月25日14时 -> 2024122514
  • 最大值限制: 2147483647
  • 超过限制时会自动使用最大值

支持的项目文件

工具会自动检测并更新以下文件(如果存在):

UniApp项目

  • package.json - 更新version字段
  • manifest.config.tssrc/manifest.json - 更新versionName和versionCode
  • src/config/index.js - 更新VERSION常量
  • .minicirc - 更新version字段

UniBest项目

  • package.json - 更新version字段
  • manifest.config.ts - 更新versionName和versionCode
  • .minicirc - 更新version字段

微信小程序项目

  • package.json - 更新version字段
  • project.miniapp.json - 更新version和versionCode字段
  • miniprogram/config/index.js - 更新VERSION常量

工作原理

  1. 自动检测: 工具会自动扫描项目目录,查找所有可能的配置文件
  2. 智能更新: 只更新存在的文件,不存在的文件会被静默跳过
  3. 版本同步: 确保所有相关文件中的版本号保持一致
  4. 错误处理: 提供友好的错误提示和帮助信息

开发

# 克隆项目
git clone <repository-url>
cd itriton-version

# 安装依赖
pnpm install

# 开发模式 (监听文件变化)
pnpm dev

# 构建项目
pnpm build

# 发布
pnpm build:publish

许可证

ISC