Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@miniflare/watcher

cloudflare327.8kMIT2.14.4TypeScript support: included

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

cloudflare, workers, worker, local, cloudworker

readme

@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();

changelog

docs/CHANGELOG.md