# @c-time/frelio-data-json-recipe 中文文档

规范地址：https://npmcn.com/package/%40c-time/frelio-data-json-recipe/

版本：3\.6\.1
npm 元数据更新时间：2026-11-07T16:08:13.918Z
中文译文更新时间：2026-11-08T22:26:21.277Z
软件包许可：MIT

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

原始 npm 页面：https://www.npmjs.com/package/%40c-time/frelio-data-json-recipe
原文对照：https://npmcn.com/package/%40c-time/frelio-data-json-recipe/?lang=original
项目主页：https://github.com/c-time/frelio#readme
源码仓库：https://github.com/c-time/frelio

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

- 包体积（解压后）：20.7 kB，5 个文件
- 模块格式：ES Module
- TypeScript 类型：包内自带
- Node.js 要求：\>=18
- 运行依赖：0 个
- 首次发布：2026-03-28T04:35:51.550Z
- 最新版本发布：2026-11-07T16:08:13.718Z
- 近 30 天下载量：3098（2026-10-09 至 2026-11-07，npm 官方下载统计）
- 已发布版本数：40（近 12 个月 40 个）

## 中文简介

Frelio 数据类型定义 JSON 配方

## 安装

```sh
npm install @c-time/frelio-data-json-recipe
```

也可以使用：`pnpm add @c-time/frelio-data-json-recipe`、`yarn add @c-time/frelio-data-json-recipe`、`bun add @c-time/frelio-data-json-recipe`

## README

# @c-time/frelio-data-json-recipe (英语)

Frelio SSG + (建设- 数据- recipe ) +=。

* * *

## (单位:千美元)

数据 - json -。

ランタイム依存なし。型定義と型ガードのみを提供する。

* * *

## インストール

```bash
npm install @c-time/frelio-data-json-recipe
```

* * *

## 使用例

```typescript
import type {
  FrelioBuildDataRecipe,
  ContentTypeRecipe,
  DetailPageRecipe,
  ListPageRecipe,
} from '@c-time/frelio-data-json-recipe'

import {
  isListPageRecipeWithPagination,
  isCustomFieldTransform,
} from '@c-time/frelio-data-json-recipe'

// レシピの型チェック
const recipe: FrelioBuildDataRecipe = {
  contentTypes: { /* ... */ },
  staticPages: [],
  templateIncludes: {},
}

// ページネーションの有無を判定
if (isListPageRecipeWithPagination(listRecipe)) {
  console.log(listRecipe.pagination.perPage)
}
```

* * *

## 主な型

| 页:1 | 説明 |
| --- | --- |
| `FrelioBuildDataRecipe` | ビルドレシピ全体の定義 |
| `ContentTypeRecipe` | コンテンツタイプごとの生成ルール |
| `DetailPageRecipe` | 詳細ページの生成設定 |
| `ListPageRecipe` | 一覧ページの生成設定(ページネーション有無で分岐) |
| `StaticPageRecipe` | 静的ページの生成設定 |
| `CustomFieldTransform` | フィールド値の変換定義 |
| `CustomFieldRelationList` | 関連コンテンツの参照定義 |
| `CustomFieldConstant` | 固定値の定義 |
| `RelationExpand` | 関連コンテンツの展開設定 |
| `RecipeSort` 编号 : `RecipeFilter` | ソート・フィルタ設定 |
| `TemplateIncludes` | テンプレート依存関係 |

### カスタムフィールドのフォーマットタイプ

`string`, (中文(简体) ), `date`, (中文(简体) ), `number`, (中文(简体) ), `escape`, (中文(简体) ), `toc`, (中文(简体) ), `truncate`, (中文(简体) ), `stripHtml`, (中文(简体) ), `slug`, (中文(简体) ), `lowercase`, (中文(简体) ), `uppercase`, (中文(简体) ), `default`, (中文(简体) ), `count`, (中文(简体) ), `first`, (中文(简体) ), `last`, (中文(简体) ), `join`, (中文(简体) ), `url`, (中文(简体) ), `picture`, (中文(简体) ), `img`, (中文(简体) ), `srcset`, (中文(简体) ), `fileLink`, (中文(简体) ), `relationList`, (中文(简体) ), `constant` 25个。

* * *

## 型ガード

| 関数 | 説明 |
| --- | --- |
| `isListPageRecipeWithPagination(recipe)` | ページネーション付き一覧レシピか判定 |
| `isListPageRecipeWithoutPagination(recipe)` | ページネーションなし一覧レシピか判定 |
| `isCustomFieldTransform(field)` | 变形QQ |
| `isCustomFieldRelationList(field)` | 关系学家 QQ |
| `isCustomFieldConstant(field)` | 常数 : |

* * *

## ライセンス

麻省理工学院

## 常见问题

### @c-time/frelio-data-json-recipe 是什么？

Frelio 数据类型定义 JSON 配方

### 如何安装 @c-time/frelio-data-json-recipe？

在项目目录运行 npm install @c-time/frelio-data-json-recipe，或使用 pnpm add / yarn add / bun add。

### @c-time/frelio-data-json-recipe 支持 TypeScript 吗？

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

### @c-time/frelio-data-json-recipe 支持 ESM 还是 CommonJS？

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

### @c-time/frelio-data-json-recipe 需要什么版本的 Node\.js？

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

### @c-time/frelio-data-json-recipe 可以商用吗？

@c-time/frelio-data-json-recipe 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @c-time/frelio-data-json-recipe 的下载量有多少？

根据 npm 官方下载统计，@c-time/frelio-data-json-recipe 在 2026/10/09 – 2026/11/07 这 30 天内被下载 3,098 次，日均约 103 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @c-time/frelio-data-json-recipe 还在维护吗？

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

