2.0.2 • Published 4 years ago

@geostarters/sftp-watcher v2.0.2

Weekly downloads
1
License
ISC
Repository
github
Last release
4 years ago

Sftp-watcher

	npm install @geostarters/sftp-watcher

SampleCode

const SftpWatcher = require("@geostarters/sftp-watcher";                            

const event = new SftpWatcher({
		host : 'your.hostname.com',
		port : 22,
		username : 'username',
		password : 'password',
		path : 'test/',
		interval: [miliseconds] /*optional: default 2000*/
	});
	
event.on("upload", function (data) {
	console.log(data)
});
event.on("delete", function (data) {
	console.log(data)
});
event.on("heartbeat", function (data) {
	console.log(data.toString())
});
event.on("close", function (data) {
	console.log(data.toString())
});
event.on("error", function (data) {
	console.log(data.toString())
});

/*To stop the watcher*/

event.emit("stop");