Skip to content

WriteOptions

Options for writing/serializing workbook files

Interface: WriteOptions

Options for writing/serializing workbook files

Hierarchy

Extends:

  • CommonOptions
  • Sheet2CSVOpts
  • Sheet2HTMLOpts

Properties

WTF

optional

WTF: boolean

If true, throw errors on unexpected situations instead of silently recovering

bookVBA

optional

bookVBA: boolean

Reserved compatibility option. A true value is unsupported and throws XlsxError ("UNSUPPORTED").

cellDates

optional

cellDates: boolean

If true, store dates as Date objects instead of serial numbers

sheetStubs

optional

sheetStubs: boolean

If true, include stub cells for empty cells within the used range

cellStyles

optional

cellStyles: boolean

If true, include style/theme information on cells

password

optional

password: string

Password for encrypted workbooks; non-empty values are unsupported and throw XlsxError ("UNSUPPORTED")

maxWorksheetCells

optional

maxWorksheetCells: number

Maximum cumulative cell work per sheet. This counts explicit cells plus generated column, hyperlink, span, and export positions. XLSX reads default to 10,000,000; exports default to 1,000,000.

type

optional

type: "string" | "base64" | "buffer" | "array"

Output data type: "base64" for base64 string, "buffer" for Node Buffer, "array" for Uint8Array, "string" for plain text

bookType

optional

bookType: "xlsx" | "xlsm" | "csv" | "tsv" | "html"

Output file format (default: "xlsx")

bookSST

optional

bookSST: boolean

If true, generate a Shared Strings Table for string deduplication

compression

optional

compression: boolean

If true, compress (deflate) ZIP entries

themeXLSX

optional

themeXLSX: string

Reserved compatibility option. A non-empty value is unsupported and throws XlsxError ("UNSUPPORTED").

ignoreEC

optional

ignoreEC: boolean

If true, skip error-checking in the output

Props

optional

Props: Properties

File properties to embed in the output

FS

optional

FS: string

Field separator (default: ",")

RS

optional

RS: string

Record separator / row delimiter (default: "\n")

strip

optional

strip: boolean

If true, strip trailing field separators from each row

blankrows

optional

blankrows: boolean

If true, include blank rows (default: true)

skipHidden

optional

skipHidden: boolean

If true, skip hidden rows and columns

forceQuotes

optional

forceQuotes: boolean

If true, wrap all fields in quotes

rawNumbers

optional

rawNumbers: boolean

If true, emit raw numeric values instead of formatted text

escapeFormulae

optional

escapeFormulae: boolean

If not false, prefix formula-like text fields with a single quote

dateNF

optional

dateNF: NumberFormat

Override date format for date cells

dateOutput

optional

dateOutput: "iso"

If "iso", emit date/datetime cells as machine-readable ISO-like strings

UTC

optional

UTC: boolean

If true, interpret dates as UTC

date1904

optional

date1904: boolean

If true, use 1904 date system for date serial numbers

id

optional

id: string

HTML id attribute for the table element

editable

optional

editable: boolean

If true, add contenteditable attribute to cells

optional

header: string

HTML to prepend before the table

optional

footer: string

HTML to append after the table

optional

sanitizeLinks: boolean

If not false, sanitize hyperlink targets to prevent XSS

Source

src/types.ts:149


← WorksheetCellBudgetOptions