• Watch file or dir.

    Parameters

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

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

          Returns void

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

          • error: Error

          Returns void

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