#Sftp file watcher
SFTP file watcher monitors the SFTP directory provided and tigger corresponding event. It's easy to start and stop process at any time.
-
install package
npm install sftp-file-watcher
var listener = require('./watcher');
var sftpConfig = {
host: "127.0.0.1",
port: 22,
username: "user_name",
password: "password",
};
var listener = new watcher(sftpConfig, "path-to-folder/");
/** triggers on the start of listening */
listener.on("init", function (data) {
console.log(data);
});
/** listen to every file upload */
listener.on("upload", function (data) {
console.log(data);
});
note: more functionalities are coming soon !!!