Add file watching example
Open
domain: documentation
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 238
- Avg merge
- 2m
- Merged PRs (30d)
- 1
Description
It would be beneficial to add a file watching example to help show people how to keep a project up to date with the file system.
---
I recommend using file watchers such as [chokidar](https://github.com/paulmillr/chokidar) alongside this.
Some methods that are helpful:
* `SourceFile#refreshFromFileSystem()`
* `SourceFile#remove()` - Removes a file from the project (not from the file system)
* `Directory#remove()` - Removes a directory from the project (not from the file system)
* `Project#addExistingSourceFileIfExists(filePath: string)` - Useful for adding a source file to the project, if it exists.
Working with directories is useful.
Contributor guide
Assessment
This issue has not been assessed yet.