1 | # fb-watchman
|
2 |
|
3 | `fb-watchman` is a filesystem watcher that uses the
|
4 | [Watchman](https://facebook.github.io/watchman/) file watching service from
|
5 | Facebook.
|
6 |
|
7 | Watchman provides file change notification services using very
|
8 | efficient recursive watches and also allows more advanced change matching and
|
9 | filesystem tree querying operations using
|
10 | [a powerful expression syntax](https://facebook.github.io/watchman/docs/file-query.html#expressions).
|
11 |
|
12 | ## Install
|
13 |
|
14 | You should [install Watchman](
|
15 | https://facebook.github.io/watchman/docs/install.html) to make the most of this
|
16 | module.
|
17 |
|
18 | Then simply:
|
19 |
|
20 | ```
|
21 | $ npm install fb-watchman
|
22 | ```
|
23 |
|
24 | ## Key Concepts
|
25 |
|
26 | - Watchman recursively watches directories.
|
27 | - Each watched directory is called a `root`.
|
28 | - You must initiate a `watch` on a `root` using the `watch-project` command prior to subscribing to changes
|
29 | - Rather than separately watching many sibling directories, `watch-project` consolidates and re-uses existing watches relative to a project root (the location of your `.watchmanconfig` or source control repository root)
|
30 | - change notifications are relative to the project root
|
31 |
|
32 | ## How do I use it?
|
33 |
|
34 | [Read the NodeJS watchman documentation](https://facebook.github.io/watchman/docs/nodejs.html)
|