Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Fix first sentence
Browse files Browse the repository at this point in the history
  • Loading branch information
mhegazy authored Jul 24, 2018
1 parent b5d5436 commit 2a49d19
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pages/Configuring Watch.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Compiler supports configuring how to watch files and directories using the environment variables.
The TypeScript compiler supports configuring how to watch files and directories using the environment variables.

## Configuring file watching using environment variable `TSC_WATCHFILE`

Expand Down Expand Up @@ -27,4 +27,4 @@ default (no value specified) | Use `fs.watch` to watch directo

`fs.watch` uses file system events to notify the changes in the file/directory. But this is OS dependent and the notification is not completely reliable and does not work as expected on many OS. Also there could be limit on number of watches that can be created, eg. linux and we could exhaust it pretty quickly with programs that include large number of files. But because this uses file system events, there is not much CPU cycle involved. Compiler typically uses `fs.watch` to watch directories (eg. source directories included by config file, directories in which module resolution failed etc) These can handle the missing precision in notifying about the changes. But recursive watching is supported on only Windows and OSX. That means we need something to replace the recursive nature on other OS.

`fs.watchFile` uses polling and thus involves CPU cycles. But this is the most reliable mechanism to get the update on the status of file/directory. Compiler typically uses `fs.watchFile` to watch source files, config files and missing files (missing file references) that means the CPU usage depends on number of files in the program.
`fs.watchFile` uses polling and thus involves CPU cycles. But this is the most reliable mechanism to get the update on the status of file/directory. Compiler typically uses `fs.watchFile` to watch source files, config files and missing files (missing file references) that means the CPU usage depends on number of files in the program.

0 comments on commit 2a49d19

Please sign in to comment.