Circle V2 API Docs
    Preparing search index...

    Module @repo/tabular-export

    @repo/tabular-export

    In-memory tabular export. Takes column definitions + rows and produces an .xlsx or .csv Buffer from one shared workbook, backed by exceljs.

    exceljs is intentionally contained to this package so the dependency surface stays out of apps/web.

    import { type ExportColumn, toCsv, toXlsx } from "@repo/tabular-export";

    type Row = { name: string; status: string };

    const columns: ExportColumn<Row>[] = [
    { header: "Name", value: (row) => row.name },
    { header: "Status", value: (row) => row.status },
    ];

    const rows: Row[] = [{ name: "Al Pacino", status: "fail" }];

    const xlsx = await toXlsx({ columns, rows, sheetName: "Report" }); // Buffer
    const csv = await toCsv({ columns, rows }); // Buffer
    • XLSX output has a frozen header row and an armed autofilter across the header range.
    • CSV output is RFC-4180 quoted (via exceljs) and runs each string cell through a formula-injection guard (leading = + - @ / tab / CR get a ' prefix). XLSX cells are typed strings and are not formula-evaluated, so they are left untouched.

    All generation is in-memory — nothing is written to disk.

    Type Aliases

    ExportCellValue
    ExportColumn
    ExportInput

    Functions

    toCsv
    toXlsx