@flatfile/plugin-zip-extractor

中文文档
0.8.1发布于 2024/12/20ISCTypeScriptESM + CJS近 30 天下载 4万

A plugin for unzipping zip files and uploading content back in Flatfile.

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

The @flatfile/plugin-zip-extractor plugin decompresses ZIP files and uploads their contents to Flatfile for further processing by other extractors.

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

Supported file types: .zip

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

Parameters

options.debug - default: false - boolean - (optional)

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

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

Usage

Listen for a ZIP file to be uploaded to Flatfile. The file will be downloaded, unzipped, and the contents uploaded back to Flatfile. Once complete, the file will be ready for import in the Files area. This plugin is designed to be used in conjuction with other extractors, such as the Excel Extractor, to extract and process the contents of the files contained in the ZIP file. Files with names beginning with . will be ignored as these are typically system files (i.e. .DS_store).

npm i @flatfile/plugin-zip-extractor
import { ZipExtractor } from "@flatfile/plugin-zip-extractor";

listener.js

listener.use(ZipExtractor());

Full Example

In this example, the ZipExtractor is initialized, and then registered as middleware with the Flatfile listener. When a JSON file is uploaded, the plugin will extract the contents of the ZIP file and upload the files to FlatFile.

import { ZipExtractor } from "@flatfile/plugin-zip-extractor";

// Initialize the ZIP extractor
const zipExtractor = ZipExtractor();

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

// When a ZIP file is uploaded, the files will be extracted and uploaded.

版本与发布记录

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

版本发布日期距今
0.8.1latest2024/12/201.9 年前
0.8.02024/11/082 年前
0.7.02024/10/302 年前
0.6.12024/10/032 年前
0.6.02024/09/242 年前
0.5.42024/09/042 年前

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

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

A plugin for unzipping zip files and uploading content back in Flatfile.

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

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

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

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

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

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

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

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

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

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

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

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

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

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