# pathwatcher

> Watch files and directories for changes

Latest version **8.1.2** (published 2021-07-06) · 0 weekly downloads

## Install

```sh
npm install pathwatcher
pnpm add pathwatcher
yarn add pathwatcher
bun add pathwatcher
```

## Health

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

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 8.1.2 |
| Published | 2021-07-06 |
| First published | 2013-04-07 |
| Weekly downloads | 0 |
| TypeScript types | separate (@types/pathwatcher) |
| Module format | CommonJS |
| Dependencies | 8 |
| Unpacked size | 96.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 93 |
| Maintainers | probablycorey, benogle, nathansobo, kevinsawicki, maxbrunsfeld, zcbenz, as-cii, atom-team |

## Links

- npm: https://www.npmjs.com/package/pathwatcher
- Repository: https://github.com/atom/node-pathwatcher
- Homepage: http://atom.github.io/node-pathwatcher
- Issues: https://github.com/atom/node-pathwatcher/issues
- npm.io page: https://npm.io/package/pathwatcher

## Dependencies (8)

- [nan](https://npm.io/package/nan.md) ^2.10.0
- [grim](https://npm.io/package/grim.md) ^2.0.1
- [async](https://npm.io/package/async.md) ~0.2.10
- [fs-plus](https://npm.io/package/fs-plus.md) ^3.0.0
- [emissary](https://npm.io/package/emissary.md) ^1.3.2
- [event-kit](https://npm.io/package/event-kit.md) ^2.1.0
- [iconv-lite](https://npm.io/package/iconv-lite.md) ~0.4.4
- [underscore-plus](https://npm.io/package/underscore-plus.md) ~1.x

## Recent versions

- 8.1.2 (latest) — 2021-07-06
- 8.1.1 — 2021-05-10
- 8.1.0 — 2019-06-12
- 8.0.2 — 2018-08-21
- 7.1.1 — 2017-08-24
- 8.0.1 — 2017-08-24
- 8.0.0 — 2017-08-18
- 7.1.0 — 2017-06-09
- 7.1.0-1 — 2017-06-01
- 7.1.0-0 — 2017-06-01
- 7.0.0 — 2017-03-06
- 6.9.0 — 2017-03-03
- 6.8.1 — 2017-02-03
- 6.8.0-1 — 2017-02-01
- 6.8.0 — 2017-01-05
- … 115 more at https://npm.io/package/pathwatcher/versions

## README

# Path Watcher Node module
![ci](https://github.com/atom/node-pathwatcher/workflows/ci/badge.svg)
[![Depenency Status](https://david-dm.org/atom/node-pathwatcher/status.svg)](https://david-dm.org/atom/node-pathwatcher)

## Installing

```bash
npm install pathwatcher
```

## Building

  * Clone the repository
  * Run `npm install` to install the dependencies
  * Run `npm test` to run the specs

## Using

```coffeescript
PathWatcher = require 'pathwatcher'
```

### PathWatcher.watch(filename, [listener])

Watch for changes on `filename`, where `filename` is either a file or a
directory. The returned object is a `PathWatcher`.

The listener callback gets two arguments `(event, path)`. `event` can be `rename`,
`delete` or `change`, and `path` is the path of the file which triggered the
event.

For directories, the `change` event is emitted when a file or directory under
the watched directory got created or deleted. And the `PathWatcher.watch` is
not recursive, so changes of subdirectories under the watched directory would
not be detected.

### PathWatcher.close()

Stop watching for changes on the given `PathWatcher`.

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