I am using fs.watchfile();
in NodeJS somewhat like the documentation example:
fs.watchFile('message.text', function (curr, prev) {});
When I use a listener:
fs.watchFile('message.text', function (curr, prev) {}, listener);
And unwatch the file:
fs.unwatchFile(message.text, listener);
The unwatchfile
removes all listeners to the file instead of the specified listener. The documentation states that it should only remove the specified listener, so what is being done incorrectly?