- Version:
12.0.0
- Platform:
Darwin Benjamins-MacBook-Pro.local 18.6.0 Darwin Kernel Version 18.6.0: Thu Apr 25 23:16:27 PDT 2019; root:xnu-4903.261.4~2/RELEASE_X86_64 x86_64
Given the following code:
var fs = require("fs");
fs.watch('./test.txt', (event, filename) => {
console.log(event, filename);
})
Running below in a directory where test.txt exists and gets deleted yields different results for event in 12.x vs 10.x:
12.x: change
10.x: rename
This basically renders node.js 12 incapable of detecting a file delete vs change when watching it.
12.0.0Darwin Benjamins-MacBook-Pro.local 18.6.0 Darwin Kernel Version 18.6.0: Thu Apr 25 23:16:27 PDT 2019; root:xnu-4903.261.4~2/RELEASE_X86_64 x86_64Given the following code:
Running below in a directory where
test.txtexists and gets deleted yields different results foreventin12.xvs10.x:12.x:change10.x:renameThis basically renders
node.js 12incapable of detecting a file delete vs change when watching it.