question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Listening for end of extraction

See original GitHub issue

Hello, I’m wrapping tar.extract within a promise for my application, and I’m having a bit of trouble listening for the end of the extraction.

Here is the code I’m using, assume that it’s wrapped within a promise and resolve and reject are defined and work properly. As well, incoming is an incoming file stream.

var extractor = tar.extract(folder);
incoming.on("error", reject);
extractor.on("error", reject);
extractor.on("end", resolve);
incoming.pipe(extractor);

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
mafintoshcommented, Jul 31, 2014

The extract stream is a writable stream. You should listen for finish to know when it is done

extractor.on('error', reject)
extractor.on('finish', resolve)

Let me know if this works for you

1reaction
mafintoshcommented, Mar 12, 2016

@eddiemonge because writable streams in node only emit finish.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why Extraction Has A Purposefully Ambiguous Ending
Ending with a time jump, Extraction's final scene finds Ovi demonstrating courage he self-professedly lacked at the start of the movie, ...
Read more >
'Extraction' on Netflix Ending Explained – Did Tyler Rake Die?
The ending of Netflix's 'Extraction' left fans with a lot of questions, including if Tyler Rake (played by Chris Hemsworth) died.
Read more >
The Mysterious Ending of Netflix's Action Thriller 'Extraction ...
The film's hero, the ruggedly handsome ex-military mercenary Tyler Rake (Hemsworth), must rescue the kidnapped child of a crime boss and return ...
Read more >
'Extraction' Ending Changed by Test Screenings - IndieWire
Tyler seemingly dies after succeeding in his mission to extract Ovi (Rudraksh Jaiswal), but the last shot of the movie sees Ovi emerging...
Read more >
Extraction (2020) Soundtrack - Soundtracki
The soundtrack from Extraction, a 2020 Netflix movie, tracklist, listen to all the 29 full soundtrack songs, play 20 full OST music &...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found