Skip to content

Cli.formatTable method

Cli › formatTable

Unofficial

Format data as a table in JSON, CSV, or TSV format.

Signature:

formatTable(headers: string[], rows: string[][], format: "csv" | "json" | "tsv"): string

Parameters:

ParameterTypeDescription
headersstring[]Column header names.
rowsstring[][]Row data as arrays of strings.
format"csv" | "json" | "tsv"Output format.

Returns: stringThe formatted table string.