var chokidar = require('chokidar');
var email = require("emailjs");
var server = email.server.connect({
user: "venkat",
password:"test",
host: "192.168.1.5",
ssl: false
});
var b = chokidar.watch('d:/back/test', { persistent: true, ignoreInitial: true })
.on('add', function(location) {console.log('File', location, 'has been added');
server.send({
text: location + ' has been added',
from: "Software Team <venkatmca008@gmail.com>",
to: "Meenakshi <venkatmca008@gmail.com>",
cc: "venkatmca008@yahoo.com",
subject: "Reg:File Notification"
}, function(err, message) { console.log(err || message); });
})
.on('addDir', function(location) {console.log('Directory', location, 'has been added');
})
.on('change', function(location) {console.log('File', location, 'has been changed');
})
.on('unlink', function(location) {console.log('File', location, 'has been removed');
})
.on('unlinkDir', function(location) {console.log('Directory', location, 'has been removed');
})
.on('error', function(error) {console.error('Error happened', error);})
var email = require("emailjs");
var server = email.server.connect({
user: "venkat",
password:"test",
host: "192.168.1.5",
ssl: false
});
var b = chokidar.watch('d:/back/test', { persistent: true, ignoreInitial: true })
.on('add', function(location) {console.log('File', location, 'has been added');
server.send({
text: location + ' has been added',
from: "Software Team <venkatmca008@gmail.com>",
to: "Meenakshi <venkatmca008@gmail.com>",
cc: "venkatmca008@yahoo.com",
subject: "Reg:File Notification"
}, function(err, message) { console.log(err || message); });
})
.on('addDir', function(location) {console.log('Directory', location, 'has been added');
})
.on('change', function(location) {console.log('File', location, 'has been changed');
})
.on('unlink', function(location) {console.log('File', location, 'has been removed');
})
.on('unlinkDir', function(location) {console.log('Directory', location, 'has been removed');
})
.on('error', function(error) {console.error('Error happened', error);})
No comments :
Post a Comment