Skip to main content
unwatchFile - node__fs.d.ts - Node documentation
function unwatchFile

Usage in Deno

```typescript import { unwatchFile } from "node:node__fs.d.ts"; ```
unwatchFile(
filename: PathLike,
listener?: StatsListener,
): void
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 [watch](../.././node__fs.d.ts/~/watch) is more efficient than `fs.watchFile()` and `fs.unwatchFile()`. `fs.watch()` should be used instead of `fs.watchFile()` and `fs.unwatchFile()` when possible.

Parameters

filename: PathLike
optional
listener: StatsListener
Optional, a listener previously attached using `fs.watchFile()`

Return Type

void
unwatchFile(
filename: PathLike,
): void

Parameters

filename: PathLike
optional
listener: BigIntStatsListener

Return Type

void