@miniflare/watcher
TypeScript icon, indicating that this package has built-in type declarations

2.14.2 • Public • Published

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

Package Sidebar

Install

npm i @miniflare/watcher

Weekly Downloads

116,647

Version

2.14.2

License

MIT

Unpacked Size

15.4 kB

Total Files

5

Last publish

Collaborators

  • wrangler-publisher