node-unzip icon indicating copy to clipboard operation
node-unzip copied to clipboard

no Directory entry caught on event "entry"

Open ronnin opened this issue 12 years ago • 3 comments

require('request')('https://github.com/yui/pure/releases/download/v0.3.0/pure-0.3.0.zip')
  .pipe(unzip.Parse())
  .on('entry', function(entry){
      if (entry === 'Directory') {
            console.log('directory found!');
      }              
  })

there' s no Directory entry found.

ronnin avatar Nov 29 '13 09:11 ronnin

I think it's:

if (entry.type === 'Directory') {

Edit: correct my mistake.

bompi88 avatar Mar 21 '17 19:03 bompi88

entry.path is the path - I think you are looking for (entry.type === 'Directory') https://github.com/EvanOxfeld/node-unzip/blob/master/lib/parse.js#L96

ZJONSSON avatar Mar 22 '17 21:03 ZJONSSON

@ZJONSSON sorry, my bad. Of course I meant the entry.type variable. I should stop commenting stuff late at night. 🥇

bompi88 avatar Mar 22 '17 21:03 bompi88