# @ama-styling/figma-extractor 中文文档

规范地址：https://npmcn.com/package/%40ama-styling/figma-extractor/

版本：15\.3\.1
npm 元数据更新时间：2026-11-10T11:03:40.036Z
中文译文更新时间：2026-11-10T12:15:18.714Z
软件包许可：BSD-3-Clause

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

原始 npm 页面：https://www.npmjs.com/package/%40ama-styling/figma-extractor
原文对照：https://npmcn.com/package/%40ama-styling/figma-extractor/?lang=original
项目主页：https://amadeusitgroup.github.io/otter/
源码仓库：https://github.com/AmadeusITGroup/otter

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

- 包体积（解压后）：122 kB，127 个文件
- TypeScript 类型：未声明
- Node.js 要求：^22\.22\.3 \|\| ^24\.15\.0 \|\| ^26\.0\.0
- 运行依赖：7 个
- peer 依赖：type-fest ^5\.3\.1，@ama-sdk/core ~15\.3\.1，@o3r/schematics ~15\.3\.1，@ama-sdk/client-fetch ~15\.3\.1，@angular-devkit/schematics ^22\.0\.0
- 首次发布：2025-08-22T02:17:56.326Z
- 最新版本发布：2026-11-10T11:03:39.500Z
- 近 30 天下载量：3290（2026-10-06 至 2026-11-04，npm 官方下载统计）
- 已发布版本数：693（近 12 个月 543 个）

## 中文简介

从 Figma 文件提取 Design Token 的工具

## 安装

```sh
npm install @ama-styling/figma-extractor
```

也可以使用：`pnpm add @ama-styling/figma-extractor`、`yarn add @ama-styling/figma-extractor`、`bun add @ama-styling/figma-extractor`

## README

# Otter 图片解析器

![Super cute Otter!](https://raw.githubusercontent.com/AmadeusITGroup/otter/main/assets/logo/otter.png)

此软件包是 [Otter 框架模块](https://github.com/AmadeusITGroup/otter/tree/main/docs/core/MODULE.md)。 。 。 .  
  

## 说明

[![Stable Version](https://img.shields.io/npm/v/@ama-styling/figma-extractor?style=for-the-badge)](https://www.npmjs.com/package/@ama-styling/figma-extractor) [![Bundle Size](https://img.shields.io/bundlephobia/min/@ama-styling/figma-extractor?color=green&style=for-the-badge)](https://www.npmjs.com/package/@ama-styling/figma-extractor)

此模块将提取 [设计托肯](https://tr.designtokens.org/format/) 来自给定的 Figma 文件的元数据 .

## 如何执行

软件包暴露于命令: `extract-file` 财务报告和审定财务报表 `extract-project`。 。 。 .  
两个命令提取 [设计托肯斯](https://tr.designtokens.org/format/) 从一个文件但 `extract-project` 将会根据文件名图案和从中提取的版本来确定要提取的文件.

### 常见选项

| 选项 | 信封变量 | 说明 |
| --- | --- | --- |
| **\-- 帮助** |  | 显示帮助 |
| **\-一个**, (中文(简体) ), **\-- 访问源** _\[弦\]_ | 斐济语NAME | 访问 Token 读取 Figma 文件信息 |
| **\- 欧**, (中文(简体) ), **\--产出** _\[弦\]_ | 图形图解 | 要提取 Design Token 的文件夹 |
| **\-没有**, (中文(简体) ), **名称** _\[弦\]_ | FIGMA DT NAME (英语) | 设计托肯收藏的名称( 默认 ): _"设计托肯斯"_(中文(简体) ) |
| **动词** |  | 确定日志是否显示调试信件( 默认 ): _虚假_(中文(简体) ) |
| **\- q (英语)**, (中文(简体) ), **\--静音** |  | 确定是否在控制台中忽略信件( 默认 ): _虚假_(中文(简体) ) |
| **\- g**, (中文(简体) ), **\-- 遗传软件包** |  | 请求生成国家防范机制软件包.json(默认: _虚假_(中文(简体) ) |
| **\-- 包装Name** _\[弦\]_ |  | Design Token收藏的版本(如果不提供 `name` 选项值将被使用) |

### 提取单个图像文件

提取 [设计托肯斯](https://tr.designtokens.org/format/) 从一个Figma文件.

```shell
npx @ama-styling/figma-extractor extract-file <fileKey> [options]
```

### 提取图像工程

提取 [设计托肯斯](https://tr.designtokens.org/format/) 从一个工程的 Figma 文件部分.

```shell
npx @ama-styling/figma-extractor extract-project <projectKey> [options]
```

以下选项专门用于: `extract-project` 命令 :

| 选项 | 信封变量 | 说明 |
| --- | --- | --- |
| **\- 临**, (中文(简体) ), **\-- 文件名** _\[弦\]_ | (原始内容存档于2018-09-26). FIGMA PROJECT FILENAME MATCHER | 文件名的模式, 抓取其版本, 在工程中匹配( 默认 : _"(?:\[0-9\]+\\.\]#0,2\] \[0-9\]+(?:-\[^\]+?)$"_(中文(简体) ) |
| **\-- 版本范围** |  | 要考虑的文件限制版本范围 |
| **项目关键** _\[弦\]_ | (原始内容存档于2013-10-12). FIGMA PROJECT KEY | Figma 工程密钥, 要提取的文件在哪里 |

## 设置自动化

完整文件可上网查阅 [Figma 提取文档](https://github.com/AmadeusITGroup/otter/tree/main/docs/figma-extractor/figma-extractor-setup.md)

## 常见问题

### @ama-styling/figma-extractor 是什么？

从 Figma 文件提取 Design Token 的工具

### 如何安装 @ama-styling/figma-extractor？

在项目目录运行 npm install @ama-styling/figma-extractor，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：@ama-sdk/core（~15\.3\.1）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。它还提供命令行工具 figma-extractor，可以用 npx figma-extractor 直接运行。

### @ama-styling/figma-extractor 支持 TypeScript 吗？

该包的 package\.json 没有声明类型入口。需要类型提示时，可以在 npm 上查找社区维护的 @types/ama-styling\_\_figma-extractor 是否存在。

### @ama-styling/figma-extractor 需要什么版本的 Node\.js？

package\.json 的 engines 字段要求 Node\.js ^22\.22\.3 \|\| ^24\.15\.0 \|\| ^26\.0\.0。版本不符时 npm 默认只给出警告，开启 engine-strict 后会拒绝安装。

### @ama-styling/figma-extractor 可以商用吗？

@ama-styling/figma-extractor 使用 BSD-3-Clause 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。另外不得用原作者名义为衍生产品背书。以上为概括，不构成法律意见，请以许可原文为准。

### @ama-styling/figma-extractor 的下载量有多少？

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

### @ama-styling/figma-extractor 还在维护吗？

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

