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

create-tanvite

v0.2.6

Published

Scaffold a TanVite starter project with optional OpenSpec, OpenAPI, Playwright, Pages, and agent assets.

Readme

create-tanvite

English | 中文

本目录是 create-tanvite npm 包的源码目录,对应发布在 npm 上的 create-tanvite 脚手架。 面向最终用户的安装与使用说明请看 仓库根 README;本 README 仅说明包内部结构

包目录结构

packages/create-tanvite/
├── bin/
│   └── create-tanvite.mjs   # 入口很薄,仅把 argv 转发给 src/index.mjs 的 run()
├── src/                     # CLI 实现(详见下文「src/ 源码结构」)
├── template/
│   └── base/                # 会被原样复制到目标目录的 starter 模板
├── package.json             # 发布用的 package 清单
├── TEMPLATE_OWNERSHIP.md    # template/ 下内容的归属与约束
├── README.md
└── README.zh-CN.md
  • bin/create-tanvite.mjs 通过 package.jsonbin 字段注册为 create-tanvite 可执行命令。其中不写任何业务逻辑,只加载 src/index.mjs 并调用 run(process.argv.slice(2))
  • template/base/ 会被原样复制到生成项目中,再根据用户选择进行 裁剪、令牌替换与补齐。生成类产物(如 src/routeTree.gen.ts不能放入模板中,详见 TEMPLATE_OWNERSHIP.md

src/ 源码结构

CLI 按单一职责切分为多个模块,index.mjs 只做编排,不写具体业务。

src/
├── index.mjs           # 编排器。通过 run(argv) 串联所有模块。
├── args.mjs            # CLI 参数解析(parseArgs)。无 I/O、无 prompt。
├── prompts.mjs         # 交互式 readline prompt(文本/是非/选项/多选/整数)。
├── features.mjs        # featureKeys、presetDefaults、resolveFeatures、resolveMaxLinesLimit、resolveHooksAgents。
├── paths.mjs           # 文件系统入口:templateDir、restoreDotfiles、ensureTargetDirectory。
├── tokens.mjs          # applyTokens:在模板中替换 __PACKAGE_NAME__ 等占位符。
├── prune.mjs           # applyFeaturePruning 以及无 OpenAPI 时的回退文件。
├── package-json.mjs    # writePackageJson、writeEnvExample;把 lint 脚本接入 `check`。
├── docs.mjs            # writeStarterDocs(README)与 writeAgentFiles(AGENTS、CLAUDE)。
├── husky.mjs           # writeHuskyHooks:重写 .husky/pre-commit 与 commit-msg。
├── agent-hooks.mjs     # writeAgentHooks:生成 .claude/settings.json、.codex/hooks.json 及钩子脚本。
├── lint-checks.mjs     # 按需生成 check-file-naming / check-max-lines 脚本。
├── utils.mjs           # 纯函数工具:sanitizePackageName、toTitleCase、unsetKeys。
├── i18n/
│   ├── index.mjs       # Locale 注册表、normalizeLocale、getMessages。
│   ├── en.mjs          # 英文 prompt、README/AGENTS 模板、lint 文案、特性标签。
│   └── zh-CN.mjs       # 对 en.mjs 的简体中文镜像。
└── README.md           # src/ 的贡献约定,后续所有改动必须遵守。

模块边界、新增 locale、新增 feature flag 的完整约定写在 src/README.md 中。后续对 CLI 的任何改动都必须 遵循那里列出的规则。

CLI 参数

| 参数 | 说明 | | ---- | ---- | | -y, --yes | 非交互模式;使用默认值 / 预设值。 | | --lang <en\|zh-CN> | 提示语、README、AGENTS.md 以及 lint 脚本输出语言。默认:en。 | | --preset <minimal\|full> | 启动预设。 | | --title <name> | 生成 UI 中显示的应用标题。 | | --package-name <name> | 覆盖根据目录推断的包名。 | | --with feat1,feat2 | 强制启用指定特性。 | | --<feature> / --no-<feature> | 启用/禁用单个特性。支持:openspecopenapiplaywrightpagesagentshookslint-file-naminglint-max-lines。 | | --max-lines <N> | lint-max-lines 检查的单文件行数上限;必须是介于 1001000 之间的整数(含两端)。默认:300。 | | --hooks-agents <claude,codex> | 为哪些代理生成钩子(需配合 --hooks)。逗号分隔。-y 模式默认:claude,codex。 |

示例:

npm create tanvite@latest my-app -- --lang zh-CN --preset full
npm create tanvite@latest my-app -- -y --lang en --preset minimal --lint-file-naming --lint-max-lines
npm create tanvite@latest my-app -- -y --preset minimal --hooks --hooks-agents claude

生成的 CLAUDE.md 仅包含一个 @AGENTS.md 引用,确保 Claude Code 与 Codex 遵循同一份说明。

本地开发

直接从仓库源码运行 bin 脚本(无需安装,无需发布):

node ./packages/create-tanvite/bin/create-tanvite.mjs <target-dir> [flags]

面向最终用户的使用流程与维护者发布流程详见 仓库根 README