Skip to content

Commit

Permalink
Add ignoreInitial docs and fix code style slightly.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmillr committed Dec 2, 2012
1 parent f8b3376 commit 7c33866
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,19 @@ watcher.close();
* `chokidar.watch(paths, options)`: takes paths to be watched and options:
* `options.ignored` (regexp or function) files to be ignored. Example:
`chokidar.watch('file', {ignored: /^\./})`.
* `options.persistent` (default: `false`). indicates whether the process
* `options.persistent` (default: `false`). Indicates whether the process
should continue to run as long as files are being watched.
* `options.ignorePermissionErrors` (default: `false`). indicates
wether to watch files that don't have read permissions or not.

* `options.ignorePermissionErrors` (default: `false`). Indicates
whether to watch files that don't have read permissions or not.
* `options.ignoreInitial` (default: `false`). Indicates whether chokidar
should ignore initial `add` events or not.
`chokidar.watch()` produces an instance of `FSWatcher`. Methods of `FSWatcher`:

* `.add(file / files)`: add directories / files for tracking.
Takes an array of strings (file paths) or just one path.
* `.on(event, callback)`: listen for an FS event.
Available events: `add`, `change`, `unlink`, `error`.
Also, `all` is available which emitted for every `add`, `change` and `unlink`.
Also, `all` is available which emitted for every `add`, `change` and `unlink`.
* `.close()`: remove all listeners from watched files.

## License
Expand Down
4 changes: 2 additions & 2 deletions src/index.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ exports.FSWatcher = class FSWatcher extends EventEmitter

# Private: Check for read permissions
# Based on this answer on SO: http://stackoverflow.com/a/11781404/1358405
#
#
# stats - fs.Stats object
#
# Returns Boolean
_hasReadPermissions: (stats) =>
not not (4 & parseInt (stats.mode & parseInt '777', 8).toString(8)[0])
Boolean (4 & parseInt (stats.mode & 0o777).toString(8)[0])

# Private: Handles emitting unlink events for
# files and directories, and via recursion, for
Expand Down

0 comments on commit 7c33866

Please sign in to comment.