@firecms/data_export

中文文档
3.5.2发布于 2026/11/11TypeScriptESM + CJS构建来源已验证近 30 天下载 5635

I'll enhance the README with more detailed documentation, configuration options, and better examples:

原始使用文档
文档目录6 节
  1. Installation
  2. Features
  3. Basic Usage
  4. Advanced Configuration
  5. Configuration Options
  6. Additional Notes

I'll enhance the README with more detailed documentation, configuration options, and better examples:

FireCMS Data Export Plugin

This plugin enables exporting Firestore collections to CSV or JSON formats directly from your FireCMS interface. It adds an export button to collection views, providing a simple way to back up data or share it with others.

Installation

npm install @firecms/data_export
# or
yarn add @firecms/data_export

Features

  • Export collection data to CSV or JSON formats
  • Configure export permissions based on collection size or custom logic
  • Integration with FireCMS analytics events
  • Custom UI for unsupported export scenarios

Basic Usage

import React from "react";
import { FireCMS } from "@firecms/core";
import { useExportPlugin } from "@firecms/data_export";


export default function App() {

    // Basic setup with default options
    const exportPlugin = useExportPlugin();
    
    const plugins = [exportPlugin];
    
    const navigationController = useBuildNavigationController({
        // ... rest of your config
        plugins
    }); 
    
    return <FireCMS
        name={"My Online Shop"}
        navigationController={navigationController}
        authentication={myAuthenticator}
        collections={myCollections}
        firebaseConfig={firebaseConfig}
    />;
}

Advanced Configuration

You can customize the export behavior with these options:

const exportPlugin = useExportPlugin({
    // Control when exports are allowed
    exportAllowed: ({ collectionEntitiesCount, path, collection }) => {
        // Prevent export of large collections
        if (collectionEntitiesCount > 5000) return false;
        
        // Only allow export for specific collections
        return ["products", "orders"].includes(path);
    },
    
    // Custom view when export is not allowed
    notAllowedView: <div>Export is not available for this collection</div>,
    
    // Track export events
    onAnalyticsEvent: (event, params) => {
        console.log("Export event:", event, params);
    }
});

Configuration Options

OptionTypeDescription
exportAllowed(params: ExportAllowedParams) => booleanFunction to determine if export is allowed for a collection
notAllowedViewReact.ReactNodeCustom component to display when export is not allowed
onAnalyticsEvent(event: string, params?: any) => voidCallback for tracking export events

Where ExportAllowedParams includes:

  • collectionEntitiesCount: Number of entities in the collection
  • path: Path of the collection
  • collection: Collection configuration object

Additional Notes

  • Exports are performed client-side and may be limited by browser capabilities for very large collections
  • CSV exports maintain data types where possible but complex objects may be simplified
  • JSON exports preserve the complete data structure

版本与发布记录

@firecms/data_export 共发布 288 个版本,首次发布于 2024/07/14;过去 12 个月发布了 79 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
3.5.2latest2026/11/114 天前
3.5.2-canary.a0001bdcanary2026/11/114 天前
3.5.2-canary.a36570e2026/10/2718 天前
3.5.2-canary.09e12812026/10/2718 天前
3.5.2-canary.c5764a32026/10/131 个月前
3.5.2-canary.16bf7bb2026/10/131 个月前

其他发布通道:pre → 3.0.0-canary.297,canary → 3.5.2-canary.a0001bd。

关于 @firecms/data_export 的常见问题

@firecms/data_export 是什么?

I'll enhance the README with more detailed documentation, configuration options, and better examples:

如何安装 @firecms/data_export?

在项目目录运行 npm install @firecms/data_export,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(>=18.3.1 || >=19.0.0)、react-dom(>=18.3.1 || >=19.0.0)、react-router(^6.28.0)、react-router-dom(^6.28.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@firecms/data_export 支持 TypeScript 吗?

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

@firecms/data_export 支持 ESM 还是 CommonJS?

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

@firecms/data_export 可以商用吗?

@firecms/data_export 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

@firecms/data_export 的下载量有多少?

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

@firecms/data_export 还在维护吗?

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