EvanOxfeld / node-unzip

node.js cross-platform unzip using streams
MIT License
613 stars 343 forks source link

When using with typescript,the process may crash #111

Closed shenchaoran closed 6 years ago

shenchaoran commented 6 years ago

I use in typescript, sometimes it will make node crash. The code is like below:

fs
    .createReadStream(fPath)
    .pipe(unzip.Extract({ path: distPath }))
    .on('error', err => next(err))
    .on('close', () => {
        // TODO here the node process will collapse sometimes

        });

the js files compiled out is the same like this. And if I run the js file it won't collapse.

shenchaoran commented 6 years ago

I know what happened, it's really a silly question. I used nodemon to restart my nodejs project, and this code is invoked after file uploaded. So the nodemon will restart my project. To resolve this, just add ignore files in nodemon.json.