https://github.com/meteor/node-pathwatcher
Path Watcher Node Module
https://github.com/meteor/node-pathwatcher
Last synced: 5 months ago
JSON representation
Path Watcher Node Module
- Host: GitHub
- URL: https://github.com/meteor/node-pathwatcher
- Owner: meteor
- License: mit
- Fork: true (atom/node-pathwatcher)
- Created: 2014-11-25T16:14:16.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2019-05-08T20:27:17.000Z (about 6 years ago)
- Last Synced: 2024-09-25T13:04:50.980Z (8 months ago)
- Language: CoffeeScript
- Homepage: http://atom.github.io/node-pathwatcher
- Size: 358 KB
- Stars: 3
- Watchers: 17
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Path Watcher Node module
[](https://travis-ci.org/atom/node-pathwatcher) [](https://ci.appveyor.com/project/Atom/node-pathwatcher) [](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`.