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

fanz-cli

v1.0.0

Published

A CLI for initializing projects from templates.

Readme

fanz-cli

fanz-cli 是一个用于初始化项目的 npm CLI 包。

它会根据模板在当前终端所在目录下自动创建项目。创建时先选择项目类型, 再输入项目名称;项目名称会作为目录名,package.json 的包名默认也使用这个名称。 如果需要修改包名,可以使用 --name

当前 express 类型默认会从 GitHub 下载模板:

https://github.com/mahoushaojo/fanzhuan-express.git

Usage

npx fanz-cli create my-app

Skip prompts:

npx fanz-cli create my-app --yes

Override the generated package name:

npx fanz-cli create my-app --name @scope/my-app

Use a specific remote template:

npx fanz-cli create my-app --template https://github.com/mahoushaojo/fanzhuan-express.git

Create an Express project:

npx fanz-cli create my-express-app --type express

Options

| Option | Description | Remark | | --- | --- | --- | | --name <package-name> | 修改生成项目的 package.json 名称 | 支持普通包名和 scope 包名,例如 @scope/my-app | | --type <express> | 指定模块类型 | 默认使用 express,express 会从 GitHub 下载模板 | | --template <git-url> | 指定远程模板 Git 仓库地址 | 优先级高于内置 express 模板地址 | | --cwd <path> | 指定项目创建位置 | 默认是当前终端所在目录,主要用于本地沙盒测试 | | -y, --yes | 跳过交互问题 | 没传项目名时会使用 my-project | | -f, --force | 允许写入非空目录 | 会覆盖同名文件,使用时需要谨慎 | | -h, --help | 查看帮助信息 | 不会创建项目 | | -v, --version | 查看版本号 | 读取当前 CLI 包的版本 |

Local Development

npm run check
node bin/fanz-cli.js create demo-app --yes --cwd /tmp

CLI Display

  • 彩色高亮使用 chalk
  • 创建过程的 loading 使用 ora
  • 交互式选择使用 inquirer,项目类型可以通过方向键上下切换,回车确认。
  • 如果本地还没有安装依赖,CLI 会降级使用内置 ANSI 颜色和简易 loading,方便直接调试。

Templates

远程模板:

  • express: https://github.com/mahoushaojo/fanzhuan-express.git

Supported placeholders in file contents and file names:

  • {{ projectName }}
  • {{ packageName }}
  • {{ moduleType }}
  • {{ pascalName }}

Remarks

  • 当前 express 模板来自 GitHub,创建时需要本机安装 git 并能访问 GitHub。
  • 模板中的文本文件会自动替换占位符,图片、字体等二进制文件会原样复制。
  • 模板文件名也可以使用占位符,例如 {{ projectName }}.config.js
  • 新增模板时,可以通过 --template <git-url> 指定远程 Git 仓库。
  • 发布到 npm 前建议执行 npm run checknpm pack --dry-run
  • 如果本机 npm cache 权限异常,可以临时使用 npm --cache /tmp/npm-cache pack --dry-run 验证打包内容。