WriteOptions
On this page
Options for writing/serializing workbook files
interface WriteOptions extends CommonOptions, Sheet2CSVOpts, Sheet2HTMLOpts
Properties
| Name | Type | Required | Description |
|---|---|---|---|
WTF | boolean | No | If true, throw errors on unexpected situations instead of silently recovering |
bookVBA | boolean | No | Reserved compatibility option. A true value is unsupported and throws XlsxError ("UNSUPPORTED"). |
cellDates | boolean | No | If true, store dates as Date objects instead of serial numbers |
sheetStubs | boolean | No | If true, include stub cells for empty cells within the used range |
cellStyles | boolean | No | If true, include style/theme information on cells |
password | string | No | Password for encrypted workbooks; non-empty values are unsupported and throw XlsxError ("UNSUPPORTED") |
maxWorksheetCells | number | No | 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. |
FS | string | No | Field separator (default: ",") |
RS | string | No | Record separator / row delimiter (default: "\n") |
strip | boolean | No | If true, strip trailing field separators from each row |
blankrows | boolean | No | If true, include blank rows (default: true) |
skipHidden | boolean | No | If true, skip hidden rows and columns |
forceQuotes | boolean | No | If true, wrap all fields in quotes |
rawNumbers | boolean | No | If true, emit raw numeric values instead of formatted text |
escapeFormulae | boolean | No | If not false, prefix formula-like text fields with a single quote |
dateNF | NumberFormat | No | Override date format for date cells |
dateOutput | "iso" | No | If "iso", emit date/datetime cells as machine-readable ISO-like strings |
UTC | boolean | No | If true, interpret dates as UTC |
date1904 | boolean | No | If true, use 1904 date system for date serial numbers |
id | string | No | HTML id attribute for the table element |
editable | boolean | No | If true, add contenteditable attribute to cells |
header | string | No | HTML to prepend before the table |
footer | string | No | HTML to append after the table |
sanitizeLinks | boolean | No | If not false, sanitize hyperlink targets to prevent XSS |
type | "base64" | "buffer" | "array" | "string" | No | Output data type: "base64" for base64 string, "buffer" for Node Buffer, "array" for Uint8Array, "string" for plain text |
bookType | "xlsx" | "xlsm" | "csv" | "tsv" | "html" | No | Output file format (default: "xlsx") |
bookSST | boolean | No | If true, generate a Shared Strings Table for string deduplication |
compression | boolean | No | If true, compress (deflate) ZIP entries |
themeXLSX | string | No | Reserved compatibility option. A non-empty value is unsupported and throws XlsxError ("UNSUPPORTED"). |
ignoreEC | boolean | No | If true, skip error-checking in the output |
Props | Properties | No | File properties to embed in the output |