# @apify/actor-templates 中文文档

规范地址：https://npmcn.com/package/%40apify/actor-templates/

版本：0\.1\.5
npm 元数据更新时间：2026-02-24T16:26:05.261Z
中文译文更新时间：2026-11-06T10:01:56.776Z
软件包许可：ISC

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

原始 npm 页面：https://www.npmjs.com/package/%40apify/actor-templates
原文对照：https://npmcn.com/package/%40apify/actor-templates/?lang=original
项目主页：https://github.com/apify/actor-templates#readme
源码仓库：https://github.com/apify/actor-templates

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

- 包体积（解压后）：9.1 kB，5 个文件
- 模块格式：ESM + CJS
- TypeScript 类型：包内自带
- 运行依赖：0 个
- 首次发布：2020-05-17T13:27:24.627Z
- 最新版本发布：2024-02-14T16:01:19.961Z
- 近 30 天下载量：46782（2026-10-06 至 2026-11-04，npm 官方下载统计）
- 已发布版本数：8（近 12 个月 0 个）

## 中文简介

描述演员模板的表单 .

## 安装

```sh
npm install @apify/actor-templates
```

也可以使用：`pnpm add @apify/actor-templates`、`yarn add @apify/actor-templates`、`bun add @apify/actor-templates`

## README

![](https://npmcn.com/package/%40apify/actor-templates/actor-logo.png)

# 认证演员模板

> 这个仓库存储锅炉板模板和代码示例,用于 [认证演员](https://apify.com/actors)。 。 。 . 这些模板的目的是帮助devlopers在Apify平台上从演员开发开始.

## 如何使用模板

你可以马上开始使用演员模板 [认证 CLI](https://docs.apify.com/cli)数字 :

```Bash
npx apify-cli create my-crawler
```

或者说

```Bash
npm -g install apify-cli
apify create my-actor
```

在运行命令后, 您将被提示从您终端显示的列表中选择一个模板 。 现有的模板是:

### 正在获取开始的模板

使用Node.js(JavaScript/Typescript),或Python开始在Apify平台上开发演员的基本模板. 只要安装CLI 并看你的演员运行.

-   [节点.js + JavaScript](https://npmcn.com/package/%40apify/actor-templates/templates/js-start/)
-   [节点.js + 类型脚本](https://npmcn.com/package/%40apify/actor-templates/templates/ts-start/)
-   [蟒](https://npmcn.com/package/%40apify/actor-templates/templates/python-start/)

您可以在 [认证 SDK 文档](https://sdk.apify.com/docs/examples/puppeteer-crawler/)。 。 。 .

### 项目锅炉板

如果你已经熟悉演员,可以使用下列模板来使用空项目模板或Crawlee模板来拖曳新项目:

#### 空项目

在 JavaScript / TypeScript (Node.js) 或 Python 中快速和轻松地启动一个新的网页刮取项目,使用我们的空项目模板. 它为演员提供了基本结构 [认证 JavaScript SDK](https://docs.apify.com/sdk/js/) 或者说 [认证 Python SDK](https://docs.apify.com/sdk/python/) 并允许您方便地添加自己的功能.

-   [空 JavaScript 工程](https://npmcn.com/package/%40apify/actor-templates/templates/js-empty/)
-   [空类型脚本工程](https://npmcn.com/package/%40apify/actor-templates/templates/ts-empty/)
-   [空 Python 工程](https://npmcn.com/package/%40apify/actor-templates/templates/python-empty/)

#### Crawlee 项目

-   [万岁克劳勒](https://npmcn.com/package/%40apify/actor-templates/templates/js-crawlee-cheerio/) (单位:千美元)[类型脚本版本](https://npmcn.com/package/%40apify/actor-templates/templates/ts-crawlee-cheerio/)) - 与Crawlee's ClayioCrawler开发的标准并更新模板.
-   [剧作家 crawler](https://npmcn.com/package/%40apify/actor-templates/templates/js-crawlee-playwright-chrome/) (单位:千美元)[类型脚本版本](https://npmcn.com/package/%40apify/actor-templates/templates/ts-crawlee-playwright-chrome/)) - 与Crawlee's Playwright Crawler一起开发的标准并更新模板.
-   [傀儡驾驶员](https://npmcn.com/package/%40apify/actor-templates/templates/js-crawlee-puppeteer-chrome/) (单位:千美元)[类型脚本版本](https://npmcn.com/package/%40apify/actor-templates/templates/ts-crawlee-puppeteer-chrome/)) - 与Crawlee's PuppeterCrawler开发的标准并更新模板.

要运行模板 :

```Bash
cd my-actor
apify run
```

## 模板 API

这个 [模板显示](https://npmcn.com/package/%40apify/actor-templates/templates/manifest.json) 可在程序上获取. 认证 CLI 用于获取最新模板 .

```Bash
npm i @apify/actor-templates
```

```JavaScript
const templates = require("@apify/actor-templates");

const manifest = await templates.fetchManifest();
```

## 发布更新/新模板

所有模板都存储在 `./templates` 目录. 每个模板都需要将整个源代码归档到 `./dist/templates` 目录. 存档用于创建一个锅炉板模板 `apify CLI` 或辅助系统中的其他地方.

### 更新和添加模板

如果您想要更改模板, 您必须更新模板文件和 [`manifest.json`](https://npmcn.com/package/%40apify/actor-templates/templates/manifest.json) 在将更改推到 `master` 树枝。 之后推到 `master`,将使用 Github 动作自动建立归档.

## 如何向 CLI 添加模板

模板被推广,以补充CLI模板. 然后在使用新添加的模板时找到 `apify create` 命令. 传播发生在将新版模板输入 `master` 树枝。 测试成功 Github 动作 正在建设 `archives` 并按这些模板 `archives` 输入存储器。 CLI 命令使用这些档案 将您的工程文件夹拖入。 我们这样做是因为 我们可以更新模板结构/代码而不发布 任何数据包到 npm。 它使模板改变敏捷.

## 参考文献

-   [认证演员文档](https://docs.apify.com/actor)
-   [认证 CLI](https://docs.apify.com/cli)
-   [认证 SDK](https://sdk.apify.com/)

## 捐款

如果您有任何改进想法,请提交问题或创建拉力请求. 缴款准则和行为守则见 [捐款额](https://npmcn.com/package/%40apify/actor-templates/CONTRIBUTING.md)。 。 。 .

## 常见问题

### @apify/actor-templates 是什么？

描述演员模板的表单 \.

### 如何安装 @apify/actor-templates？

在项目目录运行 npm install @apify/actor-templates，或使用 pnpm add / yarn add / bun add。

### @apify/actor-templates 支持 TypeScript 吗？

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

### @apify/actor-templates 支持 ESM 还是 CommonJS？

同时提供 ES Module 与 CommonJS 入口，import 和 require\(\) 都可以使用，打包工具会自动选择合适的版本。

### @apify/actor-templates 可以商用吗？

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

### @apify/actor-templates 的下载量有多少？

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

### @apify/actor-templates 还在维护吗？

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

