- watchFs(repo, path, options, onResult, onError): Promise<{
abort: (() => void);
result: Promise<null | string>;
}> 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
Optional
stats?: Stats
Returns void
- onError: ((error: Error) => void)
- (error): void
Returns void
Returns Promise<{
abort: (() => void);
result: Promise<null | string>;
}>
Watch file or dir.