@flatfile/plugin-export-workbook

中文文档
6.0.1发布于 2026/02/28ISCTypeScriptESM + CJS零依赖近 30 天下载 4.1万

A plugin for exporting data in Flatfile to Workbooks.

原始使用文档

The @flatfile/plugin-export-workbook plugin exports data in a Flatfile Workbook to a downloadable .xlsx file.

Event Type: listener.on('job:ready')

Supported file types: .xlsx

When embedding Flatfile, this plugin should be deployed in a server-side listener. Learn more

Parameters

jobName - string - (optional)

The name of job that the plugin will fire on. If not provided, workbook:downloadWorkbook will be used.

excludedSheets - string[] - (optional)

An array of sheets to be excluded from the export

excludeFields - string[] - (optional)

An array of fields to be excluded from the export

excludeMessages - boolean - (optional)

If true, messages on records will be excluded from the exported data.

recordFilter - Flatfile.Filter - (optional)

Allows filtering exported records to valid or error. By default all records will be exported

includeRecordIds - boolean - (optional)

Includes the record's ID

autoDownload - boolean - (optional)

Automatically download the file after exporting

debug - boolean - (optional)

The debug parameter lets you toggle on/off helpful debugging messages for development purposes.

sheetOptions - Record<string, ExportSheetOptions> - (optional)

A map of sheet slug to ExportSheetOptions instance providing sheet specific export options:

  • skipColumnHeaders - boolean - (optional) - allows omitting column headers
  • origin - number | SheetAddress - (optional) - allows offsetting the start of a sheet. The parameter is either a row number or an object with column and row.

Usage:

listener.use(
  exportWorkbookPlugin({
    sheetOptions: {
      SomeSheetSlug: {
        // Start the sheet at 5
        origin: 5,
        // Omit column headers
        skipColumnHeaders: true,
      },
      SomeOtherSheetSlug: {
        // Start the sheet at row 10 column 2
        origin: {row: 10, column: 2},
      },
    },
  })

columnNameTransformer - ColumnNameTransformerCallback - (optional)

A callback function allowing changing how column names appear in the workbook. The function accepts two arguments: columnName and sheetSlug and returns a new column name.

Usage

An action with the operation name of "downloadWorkbook" must be configured on a Workbook (not a Sheet) in order for the plugin to be triggered.

workbook.config.json

  // ... inside Workbook configuration
  "actions": [
    {
      "operation": "downloadWorkbook",
      "mode": "foreground",
      "label": "Download Excel Workbook",
      "description": "Downloads Excel Workbook of Data",
      "primary": true
    }
  ]
  // ...

Install

npm i @flatfile/plugin-export-workbook

listener.js

import type { FlatfileListener } from "@flatfile/listener";

import { exportWorkbookPlugin } from "@flatfile/plugin-export-workbook";

export default function (listener: FlatfileListener) {
  listener.use(exportWorkbookPlugin());
}

版本与发布记录

@flatfile/plugin-export-workbook 共发布 45 个版本,首次发布于 2023/07/26;过去 12 个月发布了 1 个版本。

版本发布日期距今
6.0.1latest2026/02/288 个月前
6.0.02025/10/181.1 年前
5.2.32025/08/281.2 年前
5.2.22025/08/271.2 年前
5.2.12025/06/211.4 年前
5.2.02025/05/161.5 年前

其他发布通道:next → 0.0.10-rc.4。

关于 @flatfile/plugin-export-workbook 的常见问题

@flatfile/plugin-export-workbook 是什么?

A plugin for exporting data in Flatfile to Workbooks.

如何安装 @flatfile/plugin-export-workbook?

在项目目录运行 npm install @flatfile/plugin-export-workbook,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:xlsx(https://cdn.sheetjs.com/xlsx-0.20.2/xlsx-0.20.2.tgz)、@flatfile/api(^1.9.19)、@flatfile/listener(^1.1.0)、@flatfile/util-common(^1.8.0)、@flatfile/plugin-job-handler(^0.8.1)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@flatfile/plugin-export-workbook 支持 TypeScript 吗?

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

@flatfile/plugin-export-workbook 支持 ESM 还是 CommonJS?

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

@flatfile/plugin-export-workbook 需要什么版本的 Node.js?

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

@flatfile/plugin-export-workbook 可以商用吗?

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

@flatfile/plugin-export-workbook 的下载量有多少?

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

@flatfile/plugin-export-workbook 还在维护吗?

最新版本 6.0.1 发布于 2026/02/28(8 个月前);至今共发布 45 个版本,其中过去 12 个月发布了 1 个;首次发布于 2023/07/26。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。