We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ExcelJs does not finish properly when using stream buffer like this:
@options.workbookOpts = { # filename: 'tmp/test.xlsx', # stream: @outputStream, useStyles: true, useSharedStrings: true }; @workbook = new Excel.stream.xlsx.WorkbookWriter @options.workbookOpts @worksheet = @workbook.addWorksheet('WSName') @workbook.stream.pipe(@outputStream) ## add some rows @workbook.commit() .then (res) => console.log("END")
On this line https://github.com/guyonroche/exceljs/blob/master/lib/stream/xlsx/workbook-writer.js#L320 you are listening for finish event which is correct for writeStreams (based on node.js doc: https://nodejs.org/api/stream.html#stream_event_finish)
finish
But here in the StreamBuf class you are emitting end event instead: https://github.com/guyonroche/exceljs/blob/master/lib/utils/stream-buf.js#L287
StreamBuf
end
Possible solutions are:
Emit finish event instead. (Or emit both end and finish events?) PR: Fire finish event instead of end event on write stream #199
Don't listen for events on StreamBuf but on zipStream instead. PR: Listen for finish event on zip stream instead of middle stream #200
Sideinfo: end event is on readStreams instead.
Workaround: is to use stream: --writeStream-- option instead of piping (in my code it is commented out).
stream: --writeStream--
The text was updated successfully, but these errors were encountered:
I almost forgot... nice work btw
Sorry, something went wrong.
Closing as it is already merged to master
No branches or pull requests
ExcelJs does not finish properly when using stream buffer like this:
On this line https://github.com/guyonroche/exceljs/blob/master/lib/stream/xlsx/workbook-writer.js#L320 you are listening for
finish
event which is correct for writeStreams (based on node.js doc: https://nodejs.org/api/stream.html#stream_event_finish)But here in the
StreamBuf
class you are emittingend
event instead:https://github.com/guyonroche/exceljs/blob/master/lib/utils/stream-buf.js#L287
Possible solutions are:
Emit
finish
event instead. (Or emit bothend
andfinish
events?)PR: Fire finish event instead of end event on write stream #199
Don't listen for events on StreamBuf but on zipStream instead.
PR: Listen for finish event on zip stream instead of middle stream #200
Sideinfo:
end
event is on readStreams instead.Workaround: is to use
stream: --writeStream--
option instead of piping (in my code it is commented out).The text was updated successfully, but these errors were encountered: