@flatfile/listener

中文文档
1.1.2发布于 2025/04/25MITTypeScriptESM + CJS近 30 天下载 93.7万

A PubSub Listener for configuring and using Flatfile

原始使用文档
文档目录8 节
  1. Components
  2. FlatfileRecord and FlatfileRecords
  3. FlatfileSession
  4. EventCache
  5. EventHandler
  6. AuthenticatedClient
  7. Various utility functions and types:
  8. Get Started

@flatfile/listener

@flatfile/listener is Flatfile's core library. It combines event handling capabilities with Flatfile-specific functionality, such as working with Flatfile records and sessions. Simply put, it receives events and it responds to events. Period.

The AuthenticatedClient class serves as a foundation for authenticated API communication, while the event-related classes enable event-driven workflows within the Flatfile ecosystem.

Components

Here's an overview of the package and its components:

FlatfileRecord and FlatfileRecords

  • These classes represent records and collections of records in the Flatfile format.
  • They provide methods for manipulating and retrieving record data.

FlatfileSession

  • This class represents a session in the Flatfile platform.
  • It stores information about the workspace, workbook, schema, uploads, and other session-related data.

EventCache

  • This class implements an event caching mechanism.
  • It allows for caching and retrieval of event data based on cache keys.

EventHandler

This class is an event handler implementation that extends the AuthenticatedClient class.

  • It provides methods for registering event listeners, dispatching events, and managing child event handlers.
  • It supports filtering events based on topic and context.
  • It can be used to handle and process events in the Flatfile platform.

AuthenticatedClient

This class is a base class for authenticated HTTP clients.

  • It provides functionality for making authenticated HTTP requests using Axios.
  • It handles access tokens, API URLs, and HTTP headers.

Various utility functions and types:

@flatfile/listener includes utility functions and types related to event handling, filtering, and data manipulation.

These utilities support the functionality of the event handling and data processing components.

Get Started

To get started with @flatfile/listener, follow our Quickstart guide.

版本与发布记录

@flatfile/listener 共发布 53 个版本,首次发布于 2023/03/02;过去 12 个月发布了 0 个版本。

版本发布日期距今
1.1.2latest2025/04/251.6 年前
1.1.12024/12/031.9 年前
1.1.02024/09/282 年前
1.0.52024/05/212 年前
1.0.42024/05/022 年前
1.0.22024/04/112 年前

其他发布通道:next → 0.3.19-rc8。

关于 @flatfile/listener 的常见问题

@flatfile/listener 是什么?

A PubSub Listener for configuring and using Flatfile

如何安装 @flatfile/listener?

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

@flatfile/listener 支持 TypeScript 吗?

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

@flatfile/listener 支持 ESM 还是 CommonJS?

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

@flatfile/listener 可以商用吗?

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

@flatfile/listener 的下载量有多少?

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

@flatfile/listener 还在维护吗?

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