# @d1testflare/watcher

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

Latest version **2.9.0** (published 2022-10-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install @d1testflare/watcher
pnpm add @d1testflare/watcher
yarn add @d1testflare/watcher
bun add @d1testflare/watcher
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.9.0 |
| Published | 2022-10-04 |
| First published | 2022-08-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=16.13 |
| Dependencies | 1 |
| Unpacked size | 15.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3923 |
| Author | MrBBot |
| Maintainers | oconnorct1 |
| Keywords | cloudflare, workers, worker, local, cloudworker |

## Links

- npm: https://www.npmjs.com/package/@d1testflare/watcher
- Repository: https://github.com/cloudflare/miniflare
- Homepage: https://github.com/cloudflare/miniflare/tree/master/packages/watcher#readme
- Issues: https://github.com/cloudflare/miniflare/issues
- npm.io page: https://npm.io/package/@d1testflare/watcher

## Dependencies (1)

- [@d1testflare/shared](https://npm.io/package/@d1testflare/shared.md) 2.9.0

## Alternatives

- [cron](https://npm.io/package/cron.md) — 4.9M weekly downloads
- [@vercel/queue](https://npm.io/package/@vercel/queue.md) — 731.6K weekly downloads
- [create-sonicjs](https://npm.io/package/create-sonicjs.md) — 1.6K weekly downloads
- [@exellix/jobs-api](https://npm.io/package/@exellix/jobs-api.md) — 941 weekly downloads
- [@forwardimpact/libskill](https://npm.io/package/@forwardimpact/libskill.md) — 575 weekly downloads

## Recent versions

- 2.9.0 (latest) — 2022-10-04
- 2.7.1 — 2022-08-30

## README

# `@d1testflare/watcher`

File-system watcher module for
[Miniflare](https://github.com/cloudflare/miniflare): a fun, full-featured,
fully-local simulator for Cloudflare Workers.

## Example

```js
import { Watcher } from "@d1testflare/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();
```

---
_Source: https://npm.io/package/@d1testflare/watcher · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
