Available

amalgame-io-filewatcher

Cross-OS mtime polling.

amc package add io-filewatcher GitHub ↗ ← Back to the ecosystem

Overview

Tree watching for dev tools (hot-reload, livereload, watch tests). No inotify/FSEvents — plain mtime polling, but ultra-portable. Powers Mosaic's dev mode.

Features

  • Recursive or shallow watching
  • Glob filters (**/*.am, !node_modules/**)
  • Unified OnChange(path, kind) callback (add / modify / delete)
  • Configurable polling (default 250 ms)
  • Cross-OS — no exotic system dep

Example

Minimal usage example — copy-paste runnable after install.

amc package add io-filewatcher

let fw = FileWatcher.New("./src", recursive: true)
fw.OnChange(fn(path, kind) {
    Console.WriteLine(kind + " " + path)
    rebuild()
})
fw.Start()

At a glance

Related packages