0

Is deleting a file not supposed to trigger a restart event? How can I capture a file being deleted? I've tried the following:

$ node
> require('nodemon')({
    ext: '*.*',
    exec: 'true',
    ignore: false,
    watch: process.cwd()
  }).
  on('restart', console.log);

Now, when I touch abc (in another terminal) I see a console.log message:

> [ '/abc' ]

However nothing happens when I rm abc.

I've also opened an issue here.

Abdullah Jibaly
  • 53,220
  • 42
  • 124
  • 197

2 Answers2

0

Closing the loop on this, for now this is not possible. See linked issue in the question for more details.

Abdullah Jibaly
  • 53,220
  • 42
  • 124
  • 197
0

An alternative npm package, watch, reacts to deletions

Jordan Morris
  • 2,101
  • 2
  • 24
  • 41