fs.unwatchFile(filename[, listener])


停止监视 filename 的变化。 如果指定了 listener,则仅移除此特定监听器,否则,将移除所有监听器,从而停止监视 filename

对未被监视的文件名调用 fs.unwatchFile() 将是空操作,而不是错误。

使用 fs.watch()fs.watchFile()fs.unwatchFile() 更高效。 应尽可能使用 fs.watch() 代替 fs.watchFile()fs.unwatchFile()

Stop watching for changes on filename. If listener is specified, only that particular listener is removed. Otherwise, all listeners are removed, effectively stopping watching of filename.

Calling fs.unwatchFile() with a filename that is not being watched is a no-op, not an error.

Using fs.watch() is more efficient than fs.watchFile() and fs.unwatchFile(). fs.watch() should be used instead of fs.watchFile() and fs.unwatchFile() when possible.