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

zhnx-cli

v0.0.9

Published

中后台管理系统前端脚手架

Readme

zhnx-cli

一个参考 Vue CLI 设计的现代化前端脚手架,支持交互式创建、模板下载(tarball 优先 / 可选 git clone)、自动安装依赖、可选初始化 Git 等能力。

🚀 最新版本

当前版本: 0.0.8

版本更新记录

v0.0.8 (2025-08-28)

  • ✨ 新增: 内置模板切换为 RuoYi 系列
    • RuoYi-Vue3 前端模板改为 GitCode 源: https://gitcode.com/yangzongzhuan/RuoYi-Vue3
    • RuoYi 后端模板改为 Gitee 源: https://gitee.com/y_project/RuoYi
    • RuoYi-Vue 前后端模板改为 Gitee 源: https://gitee.com/y_project/RuoYi-Vue
    • RuoYi-App 移动端模板改为 Gitee 源: https://gitee.com/y_project/RuoYi-App
  • 🛠️ 调整: lib/create.jsbuiltinTemplates 指向以上新地址(direct 下载优先)

v0.0.7 (2025-08-21)

  • ✨ 新增: 内置模板支持 Gitee 源
    • https://gitee.com/yudaocode/yudao-ui-admin-vue3
    • https://gitee.com/yudaocode/yudao-ui-admin-vben
  • 🛠️ 调整: 保持 CLI 控制台提示输出(创建完成/下一步等)
  • 🩹 优化: update 命令覆盖 nvm/Homebrew 等场景,未检测到全局也尽力尝试全局更新

v0.0.6 (2025-08-21)

  • 🛠️ 构建: 保留 console 输出,上线版本也显示运行提示

v0.0.5 (2025-08-21)

  • ✨ 增强: 模板下载稳健性
    • 自动探测默认分支(git ls-remote --symref),优先用实际默认分支
    • 新增 --branch <name> 手动指定分支
    • 下载顺序优化:zip 优先,其次 tar.gz;按分支顺序依次尝试
    • 支持 --timeout <ms> 自定义下载超时(默认 120000ms)
    • 失败重试:--retries <n>(默认 2 次)+ --retry-delay <ms> 指数退避
  • 🪵 调试: 可按需开启网络诊断
    • --debug 输出详细日志(stderr),便于定位镜像/分支/网络问题
  • 🖨️ 提示: 发布包保留控制台输出
    • 关闭运行时屏蔽控制台(保留“创建成功/下一步”等提示)
  • 📦 构建: 线上包清理与体积优化
    • dist/package.json 移除 scripts 与 devDependencies,仅保留运行必要字段
    • lib/ 产物统一混淆压缩;不再拷贝未混淆源码

v0.0.4 (2025-08-21)

  • 🐛 修复: 构建脚本问题修复
    • 修复发布到 npm 后缺少 lib 目录的问题
    • 确保所有运行时必需文件都包含在发布包中
    • 优化构建配置和文件复制逻辑

v0.0.2 (2025-08-21)

  • 新增: 版本检查和更新提示功能
    • 每次运行命令时自动显示当前版本和最新版本
    • 智能版本比较,提示用户是否需要更新
    • 支持多种包管理器的更新命令提示
  • 新增: zhnx-cli update 命令
    • 自动检测包管理器(npm/yarn/pnpm/bun)
    • 自动检测是否为全局安装
    • 提供详细的更新指导
  • 🔒 新增: 代码保护系统
    • 完整的代码混淆和压缩
    • 发布到 npm 后源代码得到充分保护
    • 自动化构建和发布流程
  • 🛠️ 新增: Beta 版本发布系统
    • 支持 npm run publish:beta 命令
    • 自动版本号管理(beta.1, beta.2, ...)
    • 完整的 beta 版本管理工具
  • 📝 新增: 自动化版本更新记录
    • 基于 Git 提交记录自动生成版本日志
    • 支持约定式提交格式智能分类
    • 发布时自动更新 README.md 版本记录
  • 🛠️ 优化: 构建系统重构
    • 移除临时目录依赖
    • 自动化 shebang 修复
    • 智能文件管理
    • 完善的构建脚本和发布流程

v0.0.1 (初始版本)

  • 🎯 核心功能: 项目创建脚手架
  • 📦 模板下载: 支持 tarball 和 git clone
  • 🔧 依赖管理: 自动识别包管理器
  • 🎨 交互体验: 友好的命令行交互界面

安装

npm i -g zhnx-cli
# 或在源码目录开发调试
npm link

使用

zhnx-cli create <project-name> [options]

常用示例:

# 交互创建(默认从 GitHub codeload 直接下载压缩包)
zhnx-cli create demo-project

# 指定使用 git clone(如需要完整历史或企业私服)
zhnx-cli create demo-project --clone

# 指定包管理器与 npm 源(安装依赖时生效)
zhnx-cli create demo-project --package-manager pnpm --registry https://registry.npmmirror.com

# 指定下载镜像基址(tarball 下载加速)
zhnx-cli create demo-project --mirror https://mirror.ghproxy.com/https://codeload.github.com

# 跳过依赖安装 / 初始化 Git 仓库
zhnx-cli create demo-project --no-install --git

# 强制覆盖同名目录(不再交互,直接删除)
zhnx-cli create demo-project --force

模板

  • RuoYi-Vue3前端模板(Vue3 + Element Plus): direct:https://gitcode.com/yangzongzhuan/RuoYi-Vue3.git
    仓库地址: https://gitcode.com/yangzongzhuan/RuoYi-Vue3
  • RuoYi后端模板(SpringBoot 后端): direct:https://gitee.com/y_project/RuoYi.git
    仓库地址: https://gitee.com/y_project/RuoYi
  • RuoYi-Vue前后端模板(Vue2 + Element UI): direct:https://gitee.com/y_project/RuoYi-Vue.git
    仓库地址: https://gitee.com/y_project/RuoYi-Vue
  • RuoYi-App(移动端): direct:https://gitee.com/y_project/RuoYi-App.git
    仓库地址: https://gitee.com/y_project/RuoYi-App

功能点

  • 交互式模板选择
  • 目录冲突处理:删除并继续/取消,支持 --force
  • 下载策略:
    • 默认优先使用 tarball(codeload),无需安装 git
    • --clone 时使用 git clone
    • 自动回退(main → master),下载超时提示,失败打印排查建议
    • 临时目录下载,成功后原子移动至目标目录,失败自动清理
  • 依赖安装:自动识别包管理器(pnpm/yarn/bun/npm),或使用 --package-manager 指定;支持 --registry;可 --no-install 跳过
  • Git 初始化:--git 自动 git init && git add -A && git commit -m "chore: initial commit"
  • 🔄 版本管理: 自动版本检查和更新提示
    • 每次运行命令时显示当前版本和最新版本
    • 智能版本比较,提示用户是否需要更新
    • 提供 zhnx-cli update 命令进行自动更新

开发

# 本地链接并调试
npm link

# 查看版本与帮助
zhnx-cli -V
zhnx-cli --help

🔨 构建和发布

开发构建

# 开发环境构建
npm run build

# 生产环境构建
npm run build:prod

# 清理构建文件
npm run clean

自动化发布

# Beta 版本 (0.0.2 → 0.0.2-beta.1)
npm run publish:beta

# 指定 Beta 版本号 (0.0.2 → 0.0.2-beta.2)
npm run publish:beta 2

# 补丁版本 (0.0.1 -> 0.0.2)
npm run publish:patch

# 次要版本 (0.0.1 -> 0.1.0)
npm run publish:minor

# 主要版本 (0.0.1 -> 1.0.0)
npm run publish:major

# 默认补丁版本
npm run release

Beta 版本管理

# 查看当前版本信息和可用命令
npm run beta

# 查看版本更新记录
npm run changelog

手动发布

# 构建项目
npm run build:prod

# 进入 dist 目录
cd dist

# 发布到 npm
npm publish

🔒 代码保护特性

本项目实现了完整的代码保护方案:

  • 代码混淆: 变量名混淆、字符串编码、控制流扁平化
  • 代码压缩: 移除注释、压缩变量名、优化代码结构
  • 发布保护: 自动生成 .npmignore,只发布混淆后的代码
  • 自动化流程: 一键构建、混淆、发布

详细说明请参考 BUILD_GUIDE.md

常见问题

  1. 下载卡住/失败
    • 默认使用 tarball,无需 git;如需 clone,请确保 git --version 可用
    • 可设置代理后重试:
export HTTPS_PROXY=http://127.0.0.1:7890
export ALL_PROXY=socks5://127.0.0.1:7890
  • 使用镜像加速:--mirror https://mirror.ghproxy.com/https://codeload.github.com
  1. 目录已存在未提示
    • 不带 --force 会在开始与模板选择后两次检查;带 --force 直接删除不提示

📊 项目状态

当前特性状态

  • 核心功能: 项目创建脚手架
  • 模板系统: 支持多种模板下载方式
  • 依赖管理: 自动识别和安装依赖
  • 版本管理: 自动版本检查和更新提示
  • 代码保护: 完整的混淆和压缩系统
  • 自动化发布: 一键构建和发布流程
  • 构建优化: 智能文件管理和临时文件处理

技术栈

  • 运行时: Node.js 14+
  • 构建工具: Babel + JavaScript Obfuscator + Terser
  • 包管理: 支持 npm/yarn/pnpm/bun
  • 代码保护: 企业级混淆和压缩

License

ISC