1.0.3 • Published 9 years ago
node-fswatcher v1.0.3
Node-FSWatcher
Node-FSWatcher is a super-lightweight watcher that provides a consistent API across platforms along with some cool events.
Usage:
var
FSWatcher = require('node-fswatcher');
let Watcher = FSWatcher.watch("/home/steel/test")
Watcher.on('addDir', function(Info){
console.log(Info.Path)
})
API
enum Events = {
add, addDir, unlink, unlinkDir, rename,
change, update, all
}
type InfoShape = shape( Type: String, RawType:String, Name: String, Path: String, StatsOld: ?Object, StatsNew: ?Object )
class Watcher extends EventEmitter{
Status:Boolean
constructor(RootPath: String, Recursive: Boolean)
watch(Path: String)
unwatch(Path: String)
close()
static watch(RootPath: String, ?Callback = Function, Recursive: Boolean)
}
License
This library is licensed under the terms of MIT License. See the License file for more info.