@eryx/_fs_watch Module

Summary

Classes

Functions

_fs_watch.create(path: PathLike, recursive: boolean, callback: ((event: WatchEvent) → ()))WatchHandle

API Reference

Classes

WatchHandle

Properties

WatchHandle:stop

Stops the filesystem watcher and releases its resources.

WatchHandle:stop()()

WatchHandle:ref

Makes this handle keep the event loop alive (it is unref'd by default).

WatchHandle:ref()()

WatchHandle:unref

Allows the event loop to exit even while this handle is active (the default).

WatchHandle:unref()()

Functions

_fs_watch.create

Creates a low-level filesystem watcher. The callback is invoked with a normalized event table each time the watched path changes. Set recursive to true to watch subdirectories.

_fs_watch.create(path: PathLike, recursive: boolean, callback: ((event: WatchEvent) → ()))WatchHandle

Types

WatchEventKind

type WatchEventKind = "create" | "remove" | "modify" | "rename" | "overflow" | "unknown"

WatchEvent

type WatchEvent = { kind: WatchEventKind, path: string, oldPath: string?, filename: string?, oldFilename: string?, relativePath: string?, oldRelativePath: string?, isDirectory: boolean?, rawKind: string? }
path: string
oldPath: string?
filename: string?
oldFilename: string?
relativePath: string?
oldRelativePath: string?
isDirectory: boolean?
rawKind: string?