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 🙏

© 2025 – Pkg Stats / Ryan Hefner

zozo-demo-cli

v1.0.0

Published

<!-- * @Author: chen * @Date: 2025-10-10 17:52:02 * @Description: --> # zozo-demo-cli

Readme

zozo-demo-cli

一个用于快速创建前端项目模板的命令行工具。

  • 包名: zozo-demo-cli
  • 可执行命令名: zozo-demo-cli
  • 用途: 克隆模板仓库、清理 .git、重命名 package.json、自动安装依赖

功能特点

  • 一键创建项目: create <project-name>
  • 指定分支: -b, --branch <branch>(默认 master
  • 自动安装依赖: 优先使用 Yarn,若无 Yarn 则使用 npm(带 --legacy-peer-deps
  • 友好的进度提示: 使用 orachalk

环境要求

  • Node.js: 18+(execa@9commander@14 建议 Node 18+)
  • Git: 用于克隆模板仓库
  • 包管理器: Yarn(可选),或 npm
  • 操作系统: macOS、Linux、Windows(PowerShell/WSL)

模板仓库

  • https://git.addnewer.com/datahub/template-fe.git

安装与使用

你可以选择全局安装或使用 npx 直接运行。

方式一:全局安装

# 全局安装
npm i -g zozo-demo-cli

# 使用(命令名为 bin 中声明的 zozo-demo-cli)
zozo-demo-cli create my-app
# 或指定分支
zozo-demo-cli create my-app -b develop

方式二:使用 npx(无需全局安装)

# 直接拉取并执行可执行文件
npx -p zozo-demo-cli zozo-demo-cli create my-app

# 指定分支
npx -p zozo-demo-cli zozo-demo-cli create my-app -b develop

方式三:本地开发调试

# 克隆/下载本仓库后,在项目根目录执行
npm i

# 将 CLI 链接到本地(生成 zozo-demo-cli 命令)
npm link

# 测试
zozo-demo-cli create my-app

命令说明

zozo-demo-cli create <project-name> [options]
  • : 必填,新项目目录名
  • 选项:
    • -b, --branch <branch>: 指定模板分支(默认 master

示例:

zozo-demo-cli create awesome-project
zozo-demo-cli create awesome-project -b feature/new-ui

执行流程

  1. 克隆模板仓库到 <project-name> 目录(默认分支或指定分支)
  2. 移除模板项目中的 .git 目录
  3. 将模板中的 package.json.name 重写为 <project-name>
  4. 自动安装依赖:
    • 若检测到 Yarn:执行 yarn
    • 否则:执行 npm install --legacy-peer-deps
  5. 输出下一步提示:cd <project-name>yarn start

常见问题

  • 运行失败提示未找到 git? 请先安装 Git,并确保 git 在环境变量 PATH 中可用。
  • 没有 Yarn 会怎样? 会退回使用 npm,并附带 --legacy-peer-deps 以兼容某些依赖树。
  • Windows 上需要管理员权限吗? 建议使用管理员权限的 PowerShell 或在 WSL 中执行全局安装/链接命令。

开发信息

  • 入口:bin/index.js(shebang + 动态导入 src/index.js
  • 框架/库:commander, ora, chalk, execa, fs-extra, which
  • 模块类型:ESM("type": "module"

许可证

ISC