• Watch file or dir.

    Parameters

    • repo: string
    • path: string
    • options: WatchOptions
    • onResult: ((result: {
          eventName:
              | "add"
              | "change"
              | "addDir"
              | "unlink"
              | "unlinkDir";
          path: string;
          stats?: Stats;
      }) => void)
        • (result): void
        • Parameters

          • result: {
                eventName:
                    | "add"
                    | "change"
                    | "addDir"
                    | "unlink"
                    | "unlinkDir";
                path: string;
                stats?: Stats;
            }
            • eventName:
                  | "add"
                  | "change"
                  | "addDir"
                  | "unlink"
                  | "unlinkDir"
            • path: string
            • Optionalstats?: Stats

          Returns void

    • onError: ((error: Error) => void)
        • (error): void
        • Parameters

          • error: Error

          Returns void

    Returns Promise<{
        abort: (() => void);
        result: Promise<null | string>;
    }>