@miniflare/watcher

v2.14.4
File-system watcher module for Miniflare: a fun, full-featured, fully-local simulator for Cloudflare Workers
cloudflare workers worker local cloudworker

@miniflare/watcher

File-system watcher module for Miniflare: a fun, full-featured, fully-local simulator for Cloudflare Workers.

Example

import { Watcher } from "@miniflare/watcher";

const watcher = new Watcher((changedPath) => {
  console.log(changedPath); // Absolute path logged on create, change, delete
});

// Add recursive directory watcher
watcher.watch("./dir");

// Add file watchers
watcher.watch(/* any iterable */ ["./file1.txt", "./file2.txt"]);

// Remove watchers
watcher.unwatch("./file1.txt");

// Remove all watchers
watcher.dispose();
npm i @miniflare/watcher

Metadata

  • MIT
  • >=16.13
  • MrBBot
  • released 10/7/2024

Downloads