callback for writeFile? #396
Labels
No Label
DBF
Dates
Defined Names
Features
Formula
HTML
Images
Infrastructure
Integration
International
ODS
Operations
Performance
PivotTables
Pro
Protection
Read Bug
SSF
SYLK
Style
Write Bug
good first issue
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sheetjs/sheetjs#396
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
First of all: thanks for this great tool!
XLSX.writeFile
can take quite some time to finish. And of course an error could occur.In either case the user should be informed about the outcome. Or maybe the created file should then be opened.
I must be missing something extremely obvious, but I can't find a way to pass a callback and receive error and result.
I have tried adding a callback as fourth parameter. But it seems like this is ignored.
(How) can this be done?
+1
This is a JavaScript module. Callbacks are a standard these days (especially with Node.js).
Is there any progress on this issue? @barbalex @lucdetellis were you guys able use callback? please help if you have any information.
@barbalex @lucdetellis @mrwhite1 you can just wrap
XLSX.write
.XLSX.writeFile(wb, filename, opts)
basicallysets
opts.bookType
to the appropriate output type based on the file name (so if the filename ends in.xlsx
thenopts.bookType = "xlsx"
sets
opts.type
to buffer and callsXLSX.write(wb, opts)
calls
fs.writeFileSync
on the output of the write.So it should be straightforward to write something similar: (warning: untested)