Skip to content

WriteOptions

On this page

Options for writing/serializing workbook files

interface WriteOptions extends CommonOptions, Sheet2CSVOpts, Sheet2HTMLOpts

Properties

NameTypeRequiredDescription
WTFbooleanNoIf true, throw errors on unexpected situations instead of silently recovering
bookVBAbooleanNoReserved compatibility option. A true value is unsupported and throws XlsxError ("UNSUPPORTED").
cellDatesbooleanNoIf true, store dates as Date objects instead of serial numbers
sheetStubsbooleanNoIf true, include stub cells for empty cells within the used range
cellStylesbooleanNoIf true, include style/theme information on cells
passwordstringNoPassword for encrypted workbooks; non-empty values are unsupported and throw XlsxError ("UNSUPPORTED")
maxWorksheetCellsnumberNoMaximum 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.
FSstringNoField separator (default: ",")
RSstringNoRecord separator / row delimiter (default: "\n")
stripbooleanNoIf true, strip trailing field separators from each row
blankrowsbooleanNoIf true, include blank rows (default: true)
skipHiddenbooleanNoIf true, skip hidden rows and columns
forceQuotesbooleanNoIf true, wrap all fields in quotes
rawNumbersbooleanNoIf true, emit raw numeric values instead of formatted text
escapeFormulaebooleanNoIf not false, prefix formula-like text fields with a single quote
dateNFNumberFormatNoOverride date format for date cells
dateOutput"iso"NoIf "iso", emit date/datetime cells as machine-readable ISO-like strings
UTCbooleanNoIf true, interpret dates as UTC
date1904booleanNoIf true, use 1904 date system for date serial numbers
idstringNoHTML id attribute for the table element
editablebooleanNoIf true, add contenteditable attribute to cells
headerstringNoHTML to prepend before the table
footerstringNoHTML to append after the table
sanitizeLinksbooleanNoIf not false, sanitize hyperlink targets to prevent XSS
type"base64" | "buffer" | "array" | "string"NoOutput data type: "base64" for base64 string, "buffer" for Node Buffer, "array" for Uint8Array, "string" for plain text
bookType"xlsx" | "xlsm" | "csv" | "tsv" | "html"NoOutput file format (default: "xlsx")
bookSSTbooleanNoIf true, generate a Shared Strings Table for string deduplication
compressionbooleanNoIf true, compress (deflate) ZIP entries
themeXLSXstringNoReserved compatibility option. A non-empty value is unsupported and throws XlsxError ("UNSUPPORTED").
ignoreECbooleanNoIf true, skip error-checking in the output
PropsPropertiesNoFile properties to embed in the output