This module evaluate a XML file, zip and sent to a FTP account
var igXMLSender = require("ig-xml-sender");
fs.readFile('example.xml', "utf8", (err, fd) => {
if (err) {
if (err.code === 'ENOENT') {
console.error('File does not exist');
return;
}
throw err;
}
// Process XML
igXMLSender.processXML(fd, // File
"public/test1.zip", // Destination on FTP
"file.xml", // Internal zipped file name
{ // FTP credentials
host: "localhost",
port:21,
user:"username",
pass:"password"
},
function(result){
console.info("Success:", result);// If success, result is true
});
});