fs.watch()

The Node.js function that reports changes to a file or directory using the operating system's notification system.

In more detail

The promise version returns an async iterable of events with an eventType and filename, and stops when its AbortSignal fires. Events can arrive twice or be merged, so treat them as hints to re-check.

Related terms

Taught in

References