- updated SSF to 0.9.2 - XLSB style records and number format writing - CSV avoid parseFloat (fixes #646 h/t @jabbermarky) - CSV recognize mac line ending (fixes #648 h/t @charlesread) - BIFF2 format table refactored to align with SSF - BIFF5 image data exposure - SSF custom format auto table update (fixes #267 h/t @Fangmingdu) - eslint more checks - browser test timeout extended to 10 seconds
1.7 KiB
Interface
XLSX is the exposed variable in the browser and the exported node variable
XLSX.version is the version of the library (added by the build script).
XLSX.SSF is an embedded version of the format library.
Parsing functions
XLSX.read(data, read_opts) attempts to parse data.
XLSX.readFile(filename, read_opts) attempts to read filename and parse.
Parse options are described in the Parsing Options section.
Writing functions
XLSX.write(wb, write_opts) attempts to write the workbook wb
XLSX.writeFile(wb, filename, write_opts) attempts to write wb to filename
XLSX.writeFileAsync(filename, wb, o, cb) attempts to write wb to filename.
If o is omitted, the writer will use the third argument as the callback.
XLSX.stream contains a set of streaming write functions.
Write options are described in the Writing Options section.
Utilities
Utilities are available in the XLSX.utils object:
Importing:
aoa_to_sheetconverts an array of arrays of JS data to a worksheet.
Exporting:
sheet_to_jsonconverts a worksheet object to an array of JSON objects.sheet_to_csvgenerates delimiter-separated-values output.sheet_to_formulaegenerates a list of the formulae (with value fallbacks).
Exporters are described in the Utility Functions section.
Cell and cell address manipulation:
format_cellgenerates the text value for a cell (using number formats){en,de}code_{row,col}convert between 0-indexed rows/cols and A1 forms.{en,de}code_cellconverts cell addresses{en,de}code_rangeconverts cell ranges