Stares is a inter-process node.js module to manage multiple file watchers.
With stares, you could avoid duplicately watching a same file or directory because stares instances could share with each other even if they are in different processes.
var stares = ;;
Numbersocket port to handle processes
Path|Array.<Path>the file(s) to be watched
NumberThe process id who accepts the task to watch the
Array.<Path>The files has been added to the watching list just now. Notice that
stareswon't duplicately watch a certain file, so it might be different between
Array.<Path>The current watching list.
Watch a list of files. If the current process is the master, the instance will watch these files, otherwise, stares will delegate these files to the master instance to do this job.
So, if you use
.watch() method in a subordinate process, the instance will never actually watch any files, but the master instance do.
Remove files from the watching list.
The difference of the arguments from
.watch() is that there's no
info.watched but a
info.unwatched to represent the files which has been removed just now.
Emitted when there comes a watch request
Emitted when there comes a unwatch request
Emitted if it is a master process and just listened to a port
Emitted if connected to a master process