Permalink
Browse files

Merge pull request #33 from adr-enal-in/master

Your readme was bad
  • Loading branch information...
2 parents cb151cb + 05b40a9 commit 13cbe0c52fb182ed3e4d91d5a39b088d339b402c @mikeal committed Mar 13, 2013
Showing with 6 additions and 5 deletions.
  1. +6 −5 readme.mkd
View
@@ -12,14 +12,14 @@ The intention of this module is provide tools that make managing the watching of
#### watch.watchTree(root, [options,] callback)
-The first argument is the directory root you want to watch.
+The first argument is the directory root you want to watch.
The options object is passed to fs.watchFile but can also be used to provide two additional watchTree specific options:
* `'ignoreDotFiles'` - When true this option means that when the file tree is walked it will ignore files that being with "."
* `'filter'` - You can use this option to provide a function that returns true or false for each file and directory that is walked to decide whether or not that file/directory is included in the watcher.
-The callback takes 3 arguments. The first is the file that was modified. The second is the current stat object for that file and the third is the previous stat object.
+The callback takes 3 arguments. The first is the file that was modified. The second is the current stat object for that file and the third is the previous stat object.
When a file is new the previous stat object is null.
@@ -37,7 +37,7 @@ When watchTree is finished walking the tree and adding all the listeners it pass
// f was changed
}
})
-</pre>
+</pre>
### watch.createMonitor(root, [options,] callback)
@@ -56,6 +56,7 @@ The monitor has the following events.
* `'changed'` - A file has been changed. Three arguments, the filename, the current stat object, and the previous stat object.
<pre>
+ var watch = require('watch')
watch.createMonitor('/home/mikeal', function (monitor) {
monitor.files['/home/mikeal/.zshrc'] // Stat object for my zshrc.
monitor.on("created", function (f, stat) {
@@ -67,5 +68,5 @@ The monitor has the following events.
monitor.on("removed", function (f, stat) {
// Handle removed files
})
- }
-</pre>
+ })
+</pre>

0 comments on commit 13cbe0c

Please sign in to comment.