Simple file/directory watcher. (Node.js)
It's quite simple to create a wtchr for a directory.
- an absolute dircetory path
- persistent (boolean) default:
- interval (integer) default:
- ignore (regexp) default:
var watch = ;
Wtchr provides simple event bindings. The event API is quite similar to jQuery events, so most of JS developers are familiar with it.
bind an event
.on(type, [selector], handler(path, curr lstat, prev lstat))
unbind an event
.off(type, [selector], [handler(path, curr lstat, prev lstat)])
- one of the 3 supported types
- a minimatch path selector (simply a filter)
- a event handler
var watch =watch;watch;
Simply destroy the wtchr object with the destroy method.
var watch =watch;