title: fs.createReadStream with pipe fires close event twice
body: <p>I'm using <code>fs.createReadStream</code> and the npm package <code>node-unzip-2</code> to load and unzip a zip-file onto my server and afterwards I want to use the folder where the file is unzipped for an executable. However I'm running into the problem with events, since createReadStream is both synchronous and asynchronous.</p>
  <p>My upload code is the following:</p>
  <pre><code>    spacerace.post('/file-upload', upload.single('file'), function (request, response) {
      if (request.session.loggedin) {
          request.socket.setTimeout(10 * 60 * 1000);
          console.log('File is uploaded for: ' + request.session.teamID);
          var p = `bots/${request.session.teamID}`;
          deleteFolderRecursive(p);
          console.log('Folder deleted');
          fs.createReadStream(`uploads/${request.session.teamID}/${request.session.teamID}.zip`)
              .pipe(unzip.Extract({ path: `bots/${request.session.teamID}` }))
              .on('close', () =&gt; {
                  console.log('File Unzipped');
                  try {
                      var c = execSync(
                          path.join(&quot;server&quot;, &quot;exec.exe&quot;) + &quot; -i &quot; + request.session.teamID,
                          { timeout: 5000, stdio: &quot;inherit&quot; }
  
                      )
                  }
                  catch (ex) {
                      response.send(&quot;Cannot test file: &quot; + ex).end();
                      console.log(ex);
                  }
                  console.log('File Tested');
                  response.status(200).end();
              })
              .on('finish', () =&gt; { console.log(&quot;part1done&quot;); });
      }
      else {
          response.redirect('./login');
      }
  });
  </code></pre>
  <p>The 'close' event is fired twice; ones after the <code>createReadStream</code> is finish reading the zip-file and ones after the <code>.pipe()</code> is done.</p>
  <p>I've also tried to set the <code>execSync</code> part in the 'finish' event, however that is fired before the pipe (and thus the unzip) is handeled.</p>
  <p>How can I execute the part inside the 'close' event only after the <code>.pipe()</code> is done?</p>