RAGS - v1.10.0
    Preparing search index...

    Variable monitorFile

    monitorFile: (
        path: string,
        callback?: (file: File, event: FileMonitorEvent) => void,
        options?: { flags: FileMonitorFlags; recursive: boolean },
    ) => FileMonitor | null

    Type Declaration

      • (
            path: string,
            callback?: (file: File, event: FileMonitorEvent) => void,
            options?: { flags: FileMonitorFlags; recursive: boolean },
        ): FileMonitor | null
      • Watches a file or directory for changes.

        Recursively monitors subdirectories by default. The returned monitor is kept alive internally to prevent garbage collection.

        Parameters

        • path: string

          The file or directory path to monitor

        • Optionalcallback: (file: File, event: FileMonitorEvent) => void

          Callback invoked on file changes

        • options: { flags: FileMonitorFlags; recursive: boolean } = ...

          Monitor flags and recursion setting

        Returns FileMonitor | null

        The file monitor, or null on error

        monitorFile('/tmp/myfile', (file, event) => {
        console.log('changed:', file.get_path(), event);
        });