# @fuzdev/gro 中文文档

规范地址：https://npmcn.com/package/%40fuzdev/gro/

版本：0\.237\.0
npm 元数据更新时间：2026-11-15T19:49:48.489Z
中文译文更新时间：2026-11-15T19:13:32.287Z
软件包许可：0BSD

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40fuzdev/gro
原文对照：https://npmcn.com/package/%40fuzdev/gro/?lang=original
项目主页：https://gro.fuz.dev/
源码仓库：https://github.com/fuzdev/gro

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：1.8 MB，463 个文件
- 模块格式：ES Module
- TypeScript 类型：包内自带
- Node.js 要求：\>=24\.14
- 运行依赖：3 个
- peer 依赖：vite ^5\.0\.3 \|\| ^6\.0\.0 \|\| ^7\.0\.0 \|\| ^8\.0\.0，svelte ^5，vitest ^3 \|\| ^4 \|\| ^5，typescript ^6，@sveltejs/kit ^3，svelte-docinfo \>=0\.17\.0，@fuzdev/fuz\_util \>=0\.81\.0，@fuzdev/fuz\_schema ^0\.5\.7，@fuzdev/blake3-wasm ^0\.2\.0
- 首次发布：2026-02-10T20:48:56.716Z
- 最新版本发布：2026-11-15T19:49:48.289Z
- 近 30 天下载量：5172（2026-10-16 至 2026-11-14，npm 官方下载统计）
- 已发布版本数：58（近 12 个月 58 个）

## 中文简介

安全第一联署材料运行时间和工具链

## 安装

```sh
npm install @fuzdev/gro
```

也可以使用：`pnpm add @fuzdev/gro`、`yarn add @fuzdev/gro`、`bun add @fuzdev/gro`

## README

# 单元格 ![a pixelated green oak acorn with a glint of sun](https://npmcn.com/package/%40fuzdev/gro/static/logo.svg)

[![a pixelated green oak acorn with a glint of sun](https://npmcn.com/package/%40fuzdev/gro/static/logo.svg)](https://gro.fuz.dev/)

> v8上的安全第一JS运行时间和工具链生成,运行,优化

> QQ 类型脚本工具 [不支持窗口](https://github.com/fuzdev/gro/issues/319) 因为它的产卵主舱只运行ELF,Mach-O,以及 `#!` 程序, 不是窗口 `.exe`, (中文(简体) ), `.bat`,或 `.cmd`· ; 红色 [运行时间](https://npmcn.com/src/docs/runtime.md) 会的.

今天,Gro是一个任务执行者 和工具包 扩展 [斯维尔特基特](https://github.com/sveltejs/kit) 财务报告和审定财务报表 [维特](https://github.com/vitejs/vite) 用于使用 TypeScript 创建网络前端和库. 它运行在节点上,是一种dev工具,不用于生产.

[`npm i -D @fuzdev/gro`](https://www.npmjs.com/package/@fuzdev/gro)

格罗也成为自己的JS运行时间, a V8 上的 Rust 二进制, 具有颗粒控制功能, 控制您的依赖和代理能够达到什么 . 按照设计,运行被默认限制: 代码只达到其进口申报的内容, 在不询问的情况下读取项目自己的文件,以及网络、进程和项目之外的一切 只有在小政策文件中被接受 你像锁文件一样审查, 因此,改变的能力是一个diff, 运行时间是用来强制它. 隐形跑步也是有限制的,但严格地说是决定性的, 它的时钟和随机性固定或否定, 所以它的设计是为了重放和缓存; 未限制运行( n)`-A`)是需要时的逃生舱. 运行时间是从加载器Gro中产生的 已经用于运行任务,配置,和代码gen, 从节点到网络标准. 它的型号,通过导入 没有任何环境, 这就是为什么它是一个新的运行时间 而不是德诺与其他默认. 这是一个在建工程的设计, 并且只限制 `fgro eval`其内核盒已建至今. 实验建筑运行模块,没有OS的API(没有fs,网络,env,或产卵),尽管 `fgro run`过程本身还没有被沙盒化 - 看 [运行时间文件](https://npmcn.com/src/docs/runtime.md) 为什么它存在,一个页面中的模型, 设计,和路线图, 并收到反馈意见 [讨论情况](https://github.com/fuzdev/gro/discussions)。 。 。 .

节点工具包括:

-   (单位:千美元) [任务执行器](https://npmcn.com/src/docs/task.md) 运行它的 [内建任务](https://npmcn.com/src/docs/tasks.md) 按名称 和一个项目的 `*.task.ts` 模块,按路径组成,以纯类型Script
-   [备忘](https://npmcn.com/src/docs/dev.md), (中文(简体) ), [构建](https://npmcn.com/src/docs/build.md), (中文(简体) ), [测试](https://npmcn.com/src/docs/test.md), (中文(简体) ), [部署](https://npmcn.com/src/docs/deploy.md),以及 [发布](https://npmcn.com/src/docs/publish.md) 工作流程 为SvelteKit应用程序和库包, 等待 SvelteKit 和 Vite 前端和 [`@sveltejs/package`](https://svelte.dev/docs/kit/packaging) 图书馆
-   (单位:千美元) [节点加载器](https://npmcn.com/src/lib/loader.ts) 带有 [注册钩](https://npmcn.com/src/lib/register.ts) 直接运行 TypeScript, JSON 和 SSR'd Svelte 文件(`gro run a.ts`, (中文(简体) ), 与最好的shimers为 [斯维尔特基特的 `$app` 模块](https://kit.svelte.dev/docs/modules) 在任务和测试中
-   [插件](https://npmcn.com/src/docs/plugin.md) 用于 SvelteKit 的 和其他构建进程,以可选方式配置 [`gro.config.ts`](https://npmcn.com/src/docs/config.md) (见 [默认配置](https://github.com/fuzdev/gro/blob/main/src/lib/gro.config.default.ts), (中文(简体) ), [`fuz_template`](https://github.com/fuzdev/fuz_template) 一个简单的启动器,和 [`fuz_repos`](https://github.com/fuzdev/fuz_repos) 用于自定义任务)
-   以常规编码 [`gen`](https://npmcn.com/src/docs/gen.md)
-   [测试](https://npmcn.com/src/docs/test.md) 与 [`vitest`](https://github.com/vitest-dev/vitest), (中文(简体) ), 与 [ESLint 语录](https://github.com/eslint/eslint) (我还维持) [`@ryanatkn/eslint-config`](https://github.com/ryanatkn/eslint-config), (中文(简体) ), 和格式化为 [`tsv`](https://github.com/fuzdev/tsv)
-   其模块导出自 `src/lib`,但根据 `internal/`, (中文(简体) ), 财务报告和审定财务报表 [更改](https://github.com/changesets/changesets) 用于版本和更改日志

## 文档

-   开发网络前端和库
    -   [配置](https://npmcn.com/src/docs/config.md)
    -   [备忘](https://npmcn.com/src/docs/dev.md)
    -   [构建](https://npmcn.com/src/docs/build.md) 用于生产
    -   [部署](https://npmcn.com/src/docs/deploy.md) 切入分支, 如 GitHub 页面
    -   [发布](https://npmcn.com/src/docs/publish.md) 改为npm
    -   API 参考 [/文件/附录](https://gro.fuz.dev/docs/api)
-   [`Task`](https://npmcn.com/src/docs/task.md) 运行
    -   内置 [任务](https://npmcn.com/src/docs/tasks.md) 列表
-   [测试](https://npmcn.com/src/docs/test.md) 与 [`vitest`](https://github.com/vitest-dev/vitest)
-   [`gen`](https://npmcn.com/src/docs/gen.md) 代码生成
-   实验 [运行时间](https://npmcn.com/src/docs/runtime.md),怎样 [`fgro run`](https://npmcn.com/src/docs/run.md) 财务报告和审定财务报表 [`fgro eval`](https://npmcn.com/src/docs/eval.md) 今天动手, 联合国 [安保模式](https://npmcn.com/src/docs/authority.md) 编辑 [内核备份](https://npmcn.com/src/docs/backstop.md) 在它下面, 怎么样 [解析模块](https://npmcn.com/src/docs/resolver.md) 财务报告和审定财务报表 [条形样式](https://npmcn.com/src/docs/typescript.md), (中文(简体) ), 怎么样 [比较](https://npmcn.com/src/docs/comparison.md) 到节点、德诺和邦
-   满 [文件索引](https://npmcn.com/src/docs#readme)

## 安装

> 取决于节点 \\ 24.14

典型的使用装置 [@fuzdev/gro (英语)](https://www.npmjs.com/package/@fuzdev/gro) 作为 dev 依赖:

```bash
npm i -D @fuzdev/gro
npx @fuzdev/gro # note the package is namespaced, don't install `gro`
```

全球安装也很方便:

```bash
npm i -g @fuzdev/gro
gro
```

## 使用量

Gro 有个任务运行程序, 运行 TypeScript 模块 `.task.` 子扩展 具有明确组成的进程. 以名称为主的建筑和以路径为主的项目任务. 运行 `gro` 在没有参数的情况下打印内建件和用法:

```bash
gro # prints the builtins - defers to any local gro installation
```

```
builtin tasks:

build      build the project
changeset  call changeset with gro patterns
check      check that everything is ready to commit
clean      remove build files, and optionally prune git branches
commit     commit and push to a new branch
deploy     deploy to a branch
dev        start SvelteKit and other dev plugins
format     format source files
gen        run code generation scripts
lint       run eslint
publish    bump version, publish to the configured registry, and git push
reinstall  refreshes package-lock.json with the latest and cleanest deps
release    publish and deploy
run        execute a file with the loader, like `node` but works for TypeScript
sync       optionally install packages, sync SvelteKit, update `package.json`, and run `gro gen`
test       run tests with vitest
typecheck  run svelte-check or tsc on the project without emitting any files
upgrade    upgrade deps

Run a builtin:        gro [name]
View its help:        gro [name] --help
Run a project task:   gro task [path/to/file.task.ts]
List project tasks:   gro task [dir], defaults to src/
```

一个名字总是意味着一个内建, 所以一个项目任务从来不阴影一个, 和一个路径名 完全一个任务文件, 没有搜索到 :

```bash
gro check # runs the builtin `check`
gro check --help # displays docs for the task and its args, works for every task
gro task # lists the project's tasks under `src/`
gro task src/lib/some/ # lists the tasks under `src/lib/some/`
gro task src/lib/some/file.task.ts # runs that task file
```

Gro 也可以直接运行非任务类型文件Script 与 [页:1 `gro run` 任务](https://npmcn.com/src/lib/run.task.ts) 或者说 [注册钩](https://npmcn.com/src/lib/register.ts)数字 :

```bash
gro run foo.ts --any args # everything after the path goes to the script verbatim
node --import @fuzdev/gro/register.js foo.ts
```

或在方案方面:

```js
// myfile.js
import { register } from "node:module";
register("@fuzdev/gro/loader.ts", import.meta.url);
await import("./foo.ts");
```

格罗有一些内建任务,你可以与CLI一起运行. 学习更多 [参见任务文件](https://npmcn.com/src/docs/task.md) 财务报告和审定财务报表 [生成的任务索引](https://npmcn.com/src/docs/tasks.md)。 。 。 .

```bash
gro dev # start developing in watch mode
gro dev -- vite --port 3003 # forward args by separating sections with --
```

```bash
gro build # build everything for production
```

[测试](https://npmcn.com/src/docs/test.md) 与 [`vitest`](https://github.com/vitest-dev/vitest), (中文(简体) ), 包括用于 [SvelteKit 模块](https://kit.svelte.dev/docs/modules)数字 :

```bash
gro test # run all tests for `*.test.ts` files with `vitest`
gro test filepattern1 some.test another.test
gro test optional_pattern -t "optional search string for test name"
gro test -- --forwarded_args 'to vitest' # verbatim, also `-- vitest --forwarded_args`
```

检查所有的东西:

```bash
gro check # does all of the following:
gro typecheck # svelte-check with tsc fallback
gro test # run tests
gro gen --check # ensure generated files are current
gro format --check # ensure everything is formatted
gro lint # eslint
```

使用示例见 [页:1 `check.yml` CI 配置](https://npmcn.com/package/%40fuzdev/gro/.github/workflows/check.yml)。 。 。 .

格式化为 [`tsv`](https://github.com/fuzdev/tsv)数字 :

```bash
gro format # format all of the source files using tsv
gro format --check # check that all source files are formatted
```

编码源为 [`gen`](https://npmcn.com/src/docs/gen.md)数字 :

```bash
gro gen # run codegen for all `*.gen.*` files
gro gen --check # error if any generated files are new or different
```

部署(另见 [`src/docs/deploy.md`](https://npmcn.com/src/docs/deploy.md)(中文(简体) )

```bash
gro deploy # build and push to the `deploy` branch
```

出版: (另见 [`src/docs/publish.md`](https://npmcn.com/src/docs/publish.md)(中文(简体) )

```bash
gro publish # flush changeset to changelog, bump version, publish to npm, and git push
```

更多内容:

```bash
gro clean # delete all build artifacts from the filesystem
gro clean --sveltekit --nodemodules --git # also deletes dirs and prunes git branches
gro upgrade excluded-dep-1 excluded-dep-2 # npm updates to the latest everything
gro --version # print the Gro version
```

更多东西 [任务索引](https://npmcn.com/src/docs/tasks.md), (中文(简体) ), [任务特性文件](https://npmcn.com/src/docs/task.md),以及 [文档索引](https://npmcn.com/src/docs/README.md)。 。 。 .

## 开发

```bash
npm i
npm run bootstrap # build and link `gro` without itself - needed only once
gro build # rebuilds `dist/`, which the linked `gro` CLI runs
gro test # make sure everything looks good - same as `npm test`
gro test some.test another.test

# use your development version of `gro` locally in another project:
npm link -f # points the global `gro` at this checkout, once - `npm run bootstrap` does this too
cd ../otherproject
npm link ../gro # from `otherproject/`
gro build # from `../gro` on changes
```

Rust 运行时间 `crates/` (单位:千美元)[文档](https://npmcn.com/src/docs/runtime.md))以x86 64 Linux为基础. 运行 `cargo xtask fetch-v8` 因为每个连结 被封存的 V8 存档它下载和验证. `cargo xtask build --release` 正在建设 `fgro` 与它的启动快照, `target/gro_snapshot/release/fgro run file.ts` 运行一个模块, 财务报告和审定财务报表 `cargo xtask check` 每道门都开着 罗斯特和JS两分之一.

## 功劳🐢🐢

格鲁继续前进 [类型脚本](https://github.com/microsoft/TypeScript) \* 妇女 [丝绒](https://github.com/sveltejs/svelte) \* 妇女 [斯维尔特基特](https://github.com/sveltejs/kit) \* 妇女 [维特](https://github.com/vitejs/vite) \* 妇女 [维特](https://github.com/vitest-dev/vitest) \* 妇女 [乔基达尔](https://github.com/paulmillr/chokidar) \* 妇女 [@fuzdev/fuz util (英语)](https://github.com/fuzdev/fuz_util) \* 妇女 [@fuzdev/fuz schema (法语)](https://github.com/fuzdev/fuz_schema) \* 妇女 [ESLint 语录](https://github.com/eslint/eslint) \* 妇女 [tsv 数据](https://github.com/fuzdev/tsv) \* 妇女 [丝绒检查](https://github.com/sveltejs/language-tools/tree/master/packages/svelte-check) 打开 [更多](https://npmcn.com/package/%40fuzdev/gro/package.json)

## 捐款

[fuz.dev/贡献者](https://www.fuz.dev/contributing)

## 许可证 [🐦](https://wikipedia.org/wiki/Free_and_open-source_software)

[0BSD 数据](https://npmcn.com/package/%40fuzdev/gro/LICENSE)

## 常见问题

### @fuzdev/gro 是什么？

安全第一联署材料运行时间和工具链

### 如何安装 @fuzdev/gro？

在项目目录运行 npm install @fuzdev/gro，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：svelte（^5）、typescript（^6）、@fuzdev/fuz\_util（\>=0\.81\.0）、@fuzdev/fuz\_schema（^0\.5\.7）、@fuzdev/blake3-wasm（^0\.2\.0）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。它还提供命令行工具 gro，可以用 npx gro 直接运行。

### @fuzdev/gro 支持 TypeScript 吗？

支持。包内自带 TypeScript 类型声明（package\.json 声明了 types 入口），安装后即可获得类型提示，无需再安装 @types 包。

### @fuzdev/gro 支持 ESM 还是 CommonJS？

以 ES Module 形式发布，推荐使用 import 引入。在 CommonJS 项目中，Node\.js 20\.19\+ / 22\.12\+ 可以直接 require\(\) 不含顶层 await 的 ES Module，更早的版本需要改用动态 import\(\)。

### @fuzdev/gro 需要什么版本的 Node\.js？

package\.json 的 engines 字段要求 Node\.js \>=24\.14。版本不符时 npm 默认只给出警告，开启 engine-strict 后会拒绝安装。

### @fuzdev/gro 可以商用吗？

@fuzdev/gro 使用 0BSD 许可。几乎没有限制：可自由使用、修改和分发，连保留版权声明也不要求。以上为概括，不构成法律意见，请以许可原文为准。

### @fuzdev/gro 的下载量有多少？

根据 npm 官方下载统计，@fuzdev/gro 在 2026/10/16 – 2026/11/14 这 30 天内被下载 5,172 次，日均约 172 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @fuzdev/gro 还在维护吗？

最新版本 0\.237\.0 发布于 2026/11/16（今天）；至今共发布 58 个版本，其中过去 12 个月发布了 58 个；首次发布于 2026/02/11。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

