0.1.5 • Published 12 years ago
inotifyr v0.1.5
node-inotifyr
Because file watching is hard.
Installation
$ npm install inotifyrUsage
var Inotifyr = require('inotifyr');
var watcher = new Inotifyr('path/to/watch');
watcher.on('create', function (filename, stats) {
console.log('Added %s: %s', stats.isDir ? 'dir' : 'file', filename);
});API
Inotifyr(dir[, options])
Options
An object with the following properties
events: (String | Array) Default:['create', 'modify', 'delete', 'move']A list of the events below to watch for.recursive: (Boolean) Default:falseShould sub directories be watched?onlydir: (Boolean) Default:falseOnly watch the path if it is a directory.dont_follow: (Boolean) Default:falseDo not follow symbolics linksoneshot: (Boolean) Default:falseOnly send events once
Available Events
access: File was accessed (read)attrib: Metadata changed, e.g., permissions, timestamps, extended attributes, link count (since Linux 2.6.25), UID, GID, etc.close_write: File opened for writing was closedclose_nowrite: File not opened for writing was closedcreate: File/directory created in the watched directorydelete: File/directory deleted from the watched directorydelete_self: Watched file/directory was deletedmodify: File was modifiedmove_self: Watched file/directory was movedmove_from: File moved out of the watched directorymove_to: File moved into watched directoryopen: File was openedall: Watch for all kind of eventsclose: (close_write | close_nowrite) Closemove: (move_to | move_from) Moves
Development
Executing the tests
$ npm testRunning jshint
$ npm run hint

