watch_dir.ts

view source

Declarations
#

6 declarations

watch_dir
#

watch_dir.ts view source

({ dir, on_change, filter, absolute, chokidar, ignored }: WatchDirOptions): WatchNodeFs import {watch_dir} from '@fuzdev/gro/watch_dir.js';

Watch for changes on the filesystem using chokidar.

__0

returns

WatchNodeFs

WatchDirOptions
#

watch_dir.ts view source

WatchDirOptions import type {WatchDirOptions} from '@fuzdev/gro/watch_dir.js';

dir

type string

on_change

type (change: WatcherChange): void

change

returns void

filter?

type (PathFilter) | null

chokidar?

type Partial<BasicOpts & { ignored: Matcher | Matcher[]; awaitWriteFinish: boolean | Partial<AWF>; }>

absolute?

When false, returns the path relative to dir.

type boolean

default true

ignored?

Pattern to ignore files, merged into chokidar.ignored if also provided.

  • undefined (default) ignores files matching .tmp. pattern
  • null sets no default ignore pattern
  • or some custom pattern

type Matcher | null

WatcherChange
#

WatcherChangeCallback
#

watch_dir.ts view source

WatcherChangeCallback import type {WatcherChangeCallback} from '@fuzdev/gro/watch_dir.js';

(call)

type (change: WatcherChange): void

change

returns void

WatcherChangeType
#

watch_dir.ts view source

WatcherChangeType

type "add" | "update" | "delete"

import type {WatcherChangeType} from '@fuzdev/gro/watch_dir.js';

WatchNodeFs
#

watch_dir.ts view source

WatchNodeFs import type {WatchNodeFs} from '@fuzdev/gro/watch_dir.js';

init

type (): Promise<void>

returns Promise<void>

close

type (): Promise<void>

returns Promise<void>

Imported by
#