node-sentinel-file-watcher
Linux | OS X | Windows |
---|
|
|
A simple file watcher library for node.
Usage
var nsfw = require('nsfw');
var watcherOne = new nsfw(
'dir1',
function(events) {
},
function(error) {
}
);
var watcherTwo = new nsfw(
'dir2',
function(events) {
},
function(error) {
},
5000
);
Callback Argument
An array of events as they have happened in a directory, it's children, or to a file.
[
{
"action": "CHANGED",
"directory": "/home/nsfw/watchDir",
"file": "file1.ext"
},
{
"action": "CREATED",
"directory": "/home/nsfw/watchDir",
"file": "folder"
},
{
"action": "DELETED",
"directory": "home/nsfw/watchDir/testFolder",
"file": "test.ext"
},
{
"action": "RENAMED",
"directory": "home/nsfw/watchDir",
"oldFile": "oldname.ext",
"newFile": "newname.ext"
}
]