file-watcher
FileWatcher
The FileWatcher
class provides functionalities to monitor files and directories for changes. It leverages the chokidar
library to efficiently watch files and react to changes by updating the documentation accordingly.
Kind: global class
new FileWatcher(options)
Initializes a new instance of the FileWatcher class.
Param | Type | Description |
---|---|---|
options | PluginOptions | Configuration options and plugin options. |
fileWatcher.watch()
Starts the file watching process if the "watch" argument is provided. Outputs a message to the console indicating the start of the watching process.
Kind: instance method of FileWatcher
fileWatcher.setupFileWatcher() ⇒ chokidar.FSWatcher
Configures and returns a file watcher instance targeting the source folder and README files.
Kind: instance method of FileWatcher
Returns: chokidar.FSWatcher
- An instance of the file watcher.
fileWatcher.handleFileChange(path)
Handles events when a file changes. It updates the documentation and outputs relevant messages to the console.
Kind: instance method of FileWatcher
Param | Type | Description |
---|---|---|
path | string | The path of the file that changed. |
fileWatcher.clearConsole()
Clears the console to provide a clean output for subsequent messages.
Kind: instance method of FileWatcher
fileWatcher.isReadmeFile(path, srcFolder) ⇒ boolean
Determines if the specified file is a README file.
Kind: instance method of FileWatcher
Returns: boolean
- True if the file is a README file, otherwise false.
Param | Type | Description |
---|---|---|
path | string | The path of the file to check. |
srcFolder | string | The source directory path. |
fileWatcher.updateDocumentationFile(file)
Processes and updates the documentation for the specified file.
Kind: instance method of FileWatcher
Param | Type | Description |
---|---|---|
file | DirectoryFile | Details of the file to update. |