@flatfile/plugin-delimiter-extractor

中文文档
2.5.2发布于 2025/08/18ISCTypeScriptESM + CJS近 30 天下载 2798

A plugin for parsing .delimiter files in Flatfile.

原始使用文档
文档目录4 节
  1. Parameters
  2. API Calls
  3. Usage
  4. Full Example

The @flatfile/plugin-delimiter-extractor package is a plugin for parsing delimited files and extracting them into Flatfile. It utilizes various libraries to parse files and retrieve the structured data efficiently.

Event Type: listener.on('file:created')

Supported delimiters: ;, :, ~, ^, #

Note: \t, |, and , are handled natively in the platform.

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

Parameters

fileExt - string - (required)

The fileExt parameter is used to specify the file name or extension to listen for.

options.delimiter - string - (required)

The delimiter parameter is used to specify the delimiter used in the file.

options.dynamicTyping - boolean - default: "false"

If true, numeric and boolean data will be converted to their type instead of remaining strings. Numeric data must conform to the definition of a decimal literal. Numerical values greater than 2^53 or less than -2^53 will not be converted to numbers to preserve precision. European-formatted numbers must have commas and dots swapped.

options.skipEmptyLines - boolean | 'greedy'

If true, lines that are completely empty (those which evaluate to an empty string) will be skipped. If set to greedy, lines that don't have any content (those which have only whitespace after parsing) will also be skipped.

options.transform - function

A function to apply on each value. The function receives the value as an argument The return value of the function will replace the value it received. The transform function is applied before dynamicTyping.

options.chunkSize - default: 10_000 - number - (optional)

The chunkSize parameter allows you to specify the quantity of records to in each chunk.

options.parallel - default: 1 - number - (optional)

The parallel parameter allows you to specify the number of chunks to process in parallel.

API Calls

  • api.files.download
  • api.files.get
  • api.files.update
  • api.jobs.ack
  • api.jobs.complete
  • api.jobs.create
  • api.jobs.fail
  • api.jobs.update
  • api.records.insert
  • api.workbooks.create

Usage

Listen for an delimited file to be uploaded to Flatfile. The platform will then extract the file automatically. Once complete, the file will be ready for import in the Files area.

npm i @flatfile/plugin-delimiter-extractor
import { DelimiterExtractor } from "@flatfile/plugin-delimiter-extractor";
listener.use(DelimiterExtractor(".txt", { delimiter: ":" }));

Full Example

In this example, the DelimiterExtractor is initialized for extracting TXT files with optional options, and then registered as middleware with the Flatfile listener. When a TXT file is uploaded, the plugin will extract the structured data and process it using the extractor's parser.

import { DelimiterExtractor } from "@flatfile/plugin-delimiter-extractor";

// Define optional options for the extractor (e.g., { dynamicTyping: true })
const options = {
  delimiter: ":",
  dynamicTyping: true,
  skipEmptyLines: true,
  transform: (value) => value.toUpperCase(),
};

// Initialize the TXT extractor
const delimiterExtractor = DelimiterExtractor(".txt", options);

// Register the extractor as a middleware for the Flatfile listener
listener.use(delimiterExtractor);

// When a TXT file is uploaded, the data will be extracted and processed using the extractor's parser.

版本与发布记录

@flatfile/plugin-delimiter-extractor 共发布 46 个版本,首次发布于 2023/08/02;过去 12 个月发布了 0 个版本。

版本发布日期距今
2.5.2latest2025/08/181.2 年前
2.5.12024/11/162 年前
2.5.02024/11/082 年前
2.4.02024/11/012 年前
2.3.12024/10/312 年前
2.3.02024/10/302 年前

关于 @flatfile/plugin-delimiter-extractor 的常见问题

@flatfile/plugin-delimiter-extractor 是什么?

A plugin for parsing .delimiter files in Flatfile.

如何安装 @flatfile/plugin-delimiter-extractor?

在项目目录运行 npm install @flatfile/plugin-delimiter-extractor,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@flatfile/api(^1.9.19)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@flatfile/plugin-delimiter-extractor 支持 TypeScript 吗?

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

@flatfile/plugin-delimiter-extractor 支持 ESM 还是 CommonJS?

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

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

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

@flatfile/plugin-delimiter-extractor 可以商用吗?

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

@flatfile/plugin-delimiter-extractor 的下载量有多少?

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

@flatfile/plugin-delimiter-extractor 还在维护吗?

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