Filesystem Module

File Watching

Real-time filesystem telemetry and reactive monitoring. Powered by the native XHSC event system, this module provides low-latency notification for file mutations, content deltas, and automated processing.

Event Monitoring

Monitor one or multiple paths for any change event (create, write, delete, rename).

.watch(paths, options?)

Standard event listener for path changes. The duration option (ms) defines the polling or debouncing window.

typescript
__sys__.fs.watch(["./src", "./config"], { duration: 300 });

.watchContent(paths, options?)

Monitors file content changes. If diff: true is passed, the system computes and returns delta information.

typescript
__sys__.fs.watchContent("./logs/app.log", { diff: true });

Automated Processing

.watchAndProcess (wap)

Watches a path and triggers a callback on every detected change. Ideal for auto-builds or live-reloading.

typescript
__sys__.fs.wap("./src", () => {
    console.log("Source changed — re-running build...");
});

Method Aliases

wap
watchAndProcess
wc
watchContent
wp
watchParallel
wcp
watchContentParallel
Security & Advanced

Master encryption, secure deletion, and advisory file locking.