title: node.js tar module, 'entry' readable stream
body: <p>how should I use 'entry' readable stream from tar module to <a href="https://npmjs.org/package/tar" rel="nofollow">pipe - npmsj.org</a> their content without get a stream error in pipe?</p>
  
  <p>this is to get hint for <a href="https://github.com/substack/stream-adventure?source=cc" rel="nofollow">stream-adventure - github</a> last exercise.</p>
  
  <p>I'm not looking for a answer. but a hint or advice.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>var zlib = require('zlib');
  var tar = require('tar');
  var crypto = require('crypto');
  var through = require('through');
  
  var unzip = zlib.createGunzip();
  var parser = tar.Parse();
  var stream = process.stdin.pipe(crypto.createDecipher(process.argv[2], process.argv[3])).pipe(unzip);
  var md5 = crypto.createHash('md5', { encoding: 'hex' });
  
  parser.on('entry', function(entry) {
    if (entry.type === 'File') {
      entry.pipe(md5).pipe(process.stdout);
      console.log(entry.path);
    }
  });
  
  unzip.pipe(parser);
  </code></pre>
  
  <p>here is the output:</p>
  
  <pre><code>$&gt; stream-adventure run app
  97911dcc607865d621029f6f927c7851
  stream.js:94
        throw er; // Unhandled stream error in pipe.
              ^
  Error: write after end
      at writeAfterEnd (_stream_writable.js:130:12)
      at Hash.Writable.write (_stream_writable.js:178:5)
      at Entry.ondata (stream.js:51:26)
      at Entry.EventEmitter.emit (events.js:117:20)
      at Entry._read (/home/n0t/stream-adventure/secretz/node_modules/tar/lib/entry.js:111:10)
      at Entry.write (/home/n0t/stream-adventure/secretz/node_modules/tar/lib/entry.js:68:8)
      at Parse._process (/home/n0t/stream-adventure/secretz/node_modules/tar/lib/parse.js:104:11)
      at BlockStream.&lt;anonymous&gt; (/home/n0t/stream-adventure/secretz/node_modules/tar/lib/parse.js:46:8)
      at BlockStream.EventEmitter.emit (events.js:95:17)
      at BlockStream._emitChunk (/home/n0t/stream-adventure/secretz/node_modules/tar/node_modules/block-stream/block-stream.js:145:10)
  </code></pre>
  
  <p>and with the <code>verify</code>:</p>
  
  <pre><code>$&gt; stream-adventure verify app
  
  ACTUAL:   "97911dcc607865d621029f6f927c7851"
  EXPECTED: "97911dcc607865d621029f6f927c7851 secretz/METADATA.TXT"
  
  ACTUAL:   null
  EXPECTED: "2cdcfa9f8bbefb82fb7a894964b5c199 secretz/SPYING.TXT"
  
  ACTUAL:   null
  EXPECTED: ""
  
  # FAIL
  </code></pre>