node-archiver
node-archiver copied to clipboard
How can i know that the stream is finished?
It says in the example docs that after calling archive.finalize()
'close', 'end' or 'finish' may be fired right after calling this method so register to them beforehand
Ok, so they may fire, how can i guaranty that they will fire? And which one? It specifies or, but no explanation to which event?
Was looking at the same event, 'finish' was emitted in archiver v1 but since I updated this library, nothing clearely shows that.
I think the doc is outdated because I cannot seem to find any emit('finish')
inside the library code.
A solution might be to call whatever you want to do after archive.finalize()
(for a build script in my case)
Looking for more clarification from the authors :)
I think there is a confusion here, the documentation say that MAY fire after calling the finalize, but it's talking that can be done instantly or a bit later. Not that are not going to be fired.
The events don't appear because those are stream.Writable
events from node:
https://nodejs.org/api/stream.html#class-streamwritable