
Security News
GitHub Actions Checkout Now Blocks Risky pull_request_target Checkouts
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.
create-crack
Advanced tools
🚀 一个现代化的项目脚手架工具,帮助你快速创建 React 项目。
# 使用 npm
npm install -g create-crack
# 使用 yarn
yarn global add create-crack
# 使用 pnpm
pnpm add -g create-crack
无需安装,直接使用包管理器运行:
# 使用 npx (npm 5.2+)
npx create-crack my-app
# 使用 yarn
yarn create crack my-app
# 使用 pnpm
pnpm create crack my-app
# 使用 cnpm
cnpx create-crack my-app
最简单的使用方式,工具会引导你完成所有配置:
npx create-crack my-app
然后按照提示选择:
如果你知道具体配置,可以直接通过参数指定:
# 创建 TypeScript 项目,使用 pnpm,启用所有功能
npx create-crack my-app -t react-web-ts -p pnpm -e -c
# 创建 JavaScript 项目,使用 npm,只启用 ESLint
npx create-crack my-app --template react-web-js --package-manager npm --eslint
| 选项 | 简写 | 描述 | 可选值 |
|---|---|---|---|
--template | -t | 项目模板 | react-web-js, react-web-ts |
--package-manager | -p | 包管理器 | npm, yarn, pnpm, cnpm |
--eslint | -e | 启用 ESLint | - |
--commit-lint | -c | 启用 Commit Lint | - |
--no-eslint | - | 禁用 ESLint | - |
--no-commit-lint | - | 禁用 Commit Lint | - |
--force | -f | 强制覆盖已存在的目录 | - |
--help | -h | 显示帮助信息 | - |
--version | -V | 显示版本号 | - |
react-web-js)react-web-ts)# 直接使用 npx(推荐)
npx create-crack my-app
# 全局安装后使用
npm install -g create-crack
create-crack my-app
# 指定包管理器
npx create-crack my-app --package-manager npm
# 使用 yarn create(推荐)
yarn create crack my-app
# 全局安装后使用
yarn global add create-crack
create-crack my-app
# 指定包管理器
yarn create crack my-app --package-manager yarn
# 使用 pnpm create(推荐)
pnpm create crack my-app
# 全局安装后使用
pnpm add -g create-crack
create-crack my-app
# 指定包管理器
pnpm create crack my-app --package-manager pnpm
# 使用 cnpx
cnpx create-crack my-app
# 全局安装后使用
cnpm install -g create-crack
create-crack my-app
# 指定包管理器
cnpx create-crack my-app --package-manager cnpm
# 交互式创建项目
npx create-crack my-react-app
# TypeScript 项目 + 完整配置
npx create-crack my-ts-app -t react-web-ts -p pnpm -e -c
# JavaScript 项目 + 基础配置
npx create-crack my-js-app -t react-web-js -p npm
# 最小化项目(无额外工具)
npx create-crack my-minimal-app -t react-web-js -p yarn --no-eslint --no-commit-lint
# 推荐的团队开发配置
npx create-crack team-project \
--template react-web-ts \
--package-manager pnpm \
--eslint \
--commit-lint
创建的项目将包含以下结构:
my-app/
├── src/
│ ├── App.jsx/tsx # 主应用组件
│ └── index.jsx/tsx # 入口文件
├── public/
│ └── index.html # HTML 模板
├── package.json # 项目配置
├── .gitignore # Git 忽略文件
├── .prettierrc # Prettier 配置
├── eslint.config.mjs # ESLint 配置(可选)
├── commitlint.config.js # Commit Lint 配置(可选)
└── README.md # 项目说明
创建项目后,你可以使用以下命令:
# 进入项目目录
cd my-app
# 启动开发服务器
npm start # 或 yarn start / pnpm start
# 构建生产版本
npm run build # 或 yarn build / pnpm build
# 代码检查(如果启用了 ESLint)
npm run lint # 或 yarn lint / pnpm lint
如果选择启用 ESLint,项目将包含:
npm run lint 自动修复问题如果选择启用 Commit Lint,项目将包含:
<type>(<scope>): <description>
[optional body]
[optional footer]
示例:
feat(auth): add user login functionality
fix(ui): resolve button alignment issue
docs(readme): update installation guide
工具会自动获取以下包的最新版本:
@verve-kit/react-script - 自有构建工具网络问题
# 使用国内镜像
npx create-crack my-app --registry https://registry.npmmirror.com
权限问题
# 使用 sudo(macOS/Linux)
sudo npx create-crack my-app
缓存问题
# 清除 npx 缓存
npx clear-npx-cache
npx create-crack@latest my-app
# 查看帮助信息
npx create-crack --help
# 查看版本信息
npx create-crack --version
欢迎提交 Issue 和 Pull Request!
MIT License
Happy Coding! 🎉
FAQs
CLI tool for creating crack projects
The npm package create-crack receives a total of 6 weekly downloads. As such, create-crack popularity was classified as not popular.
We found that create-crack demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.