# simple-watcher

> "A simple deep directory watcher with zero dependencies and built-in deduplication.."

Latest version **6.0.1** (published 2025-05-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install simple-watcher
pnpm add simple-watcher
yarn add simple-watcher
bun add simple-watcher
```

Provides the command `simple-watcher`.

## Health

**Score 40/100 (D)** — status: stable.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 6.0.1 |
| Published | 2025-05-17 |
| First published | 2016-05-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=22.15.0 |
| Dependencies | 0 |
| Unpacked size | 6.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Michal Kochel |
| Maintainers | gavoja |
| Keywords | file, system, directory, recursive, watch, watcher |

## Links

- npm: https://www.npmjs.com/package/simple-watcher
- Repository: https://github.com/gavoja/simple-watcher
- Homepage: https://github.com/gavoja/simple-watcher#readme
- Issues: https://github.com/gavoja/simple-watcher/issues
- npm.io page: https://npm.io/package/simple-watcher

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 6.0.1 (latest) — 2025-05-17
- 0.0.1-alpha (alpha) — 2016-05-06
- 6.0.0 — 2025-05-17
- 5.0.1 — 2022-07-11
- 5.0.0 — 2021-03-16
- 4.0.2 — 2021-03-14
- 4.0.1 — 2020-03-23
- 4.0.0 — 2018-12-05
- 3.0.0 — 2016-11-15
- 2.0.1 — 2016-11-05
- 2.0.0 — 2016-11-05
- 1.0.5 — 2016-09-15
- 1.0.4 — 2016-07-12
- 1.0.3 — 2016-07-12
- 1.0.2 — 2016-07-12
- … 5 more at https://npm.io/package/simple-watcher/versions

## README

# Simple Watcher

A simple deep directory watcher with zero dependencies and built-in deduplication.

## Usage

### Command line

```
Usage:
  simple-watcher path1 [path2 path3 ...]
```

### JavaScript

```js
import watch from 'simple-watcher'

// Optional: abort the watcher after 10 seconds.
const ac = new AbortController()
setTimeout(() => ac.abort(), 10000)

// Watch over file or directory.
for await (const changedPath of watch('/path/to/foo'), { signal: ac.signal }) {
  console.log(`Changed: ${filePath}`)
}

// Watch over multiple paths.
for await (const changedPath of watch(['/path/to/bar', '/path/to/baz']), { signal: ac.signal }) {
  console.log(`Changed: ${filePath}`)
}

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