# watch-files

> watch files by polling

Latest version **1.1.0** (published 2014-11-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install watch-files
pnpm add watch-files
yarn add watch-files
bun add watch-files
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2014-11-19 |
| First published | 2014-11-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | dead-horse |
| Maintainers | dead_horse |
| Keywords | watcher, simple files, polling |

## Links

- npm: https://www.npmjs.com/package/watch-files
- Repository: git@github.com:node-modules/watch-files
- Homepage: https://github.com/node-modules/watch-files
- Issues: https://github.com/node-modules/watch-files/issues
- npm.io page: https://npm.io/package/watch-files

## Dependencies (3)

- [debug](https://npm.io/package/debug.md) *
- [sdk-base](https://npm.io/package/sdk-base.md) ~1.0.1
- [humanize-ms](https://npm.io/package/humanize-ms.md) ~1.0.0

## Recent versions

- 1.1.0 (latest) — 2014-11-19
- 1.0.0 — 2014-11-18

## README

watch-files
---------------

[![NPM version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![Test coverage][coveralls-image]][coveralls-url]
[![David deps][david-image]][david-url]
[![node version][node-image]][node-url]
[![Gittip][gittip-image]][gittip-url]

[npm-image]: https://img.shields.io/npm/v/watch-files.svg?style=flat-square
[npm-url]: https://npmjs.org/package/watch-files
[travis-image]: https://img.shields.io/travis/node-modules/watch-files.svg?style=flat-square
[travis-url]: https://travis-ci.org/node-modules/watch-files
[coveralls-image]: https://img.shields.io/coveralls/node-modules/watch-files.svg?style=flat-square
[coveralls-url]: https://coveralls.io/r/node-modules/watch-files?branch=master
[david-image]: https://img.shields.io/david/node-modules/watch-files.svg?style=flat-square
[david-url]: https://david-dm.org/node-modules/watch-files
[node-image]: https://img.shields.io/badge/node.js-%3E=_0.10-green.svg?style=flat-square
[node-url]: http://nodejs.org/download/
[gittip-image]: https://img.shields.io/gittip/dead-horse.svg?style=flat-square
[gittip-url]: https://www.gittip.com/dead-horse/

watch files by polling

## Installation

```bash
$ npm install watch-files --save
```

## Usage

```js
var Watcher = require('watch-file');

var watcher = Watcher({
  interval: '1m'
});

watcher.add('file.txt');
watcher.add('file.json');

watcher.on('change', function (info) {
  // info.path => resolved file path
  // info.remove => false
  // info.stat (file stat)
});

watcher.on('remove', function (info) {
  // info.path => resolved file path
  // info.remove => true
});

watcher.on('all', function (info) {
  // info.path => resolved file path
  // info.remove => false | true
});

watcher.on('error', function (err) {
  // stat err
});
```

### License

MIT

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