So I have NodeJS and installed the module xml2js. In the tutorial we have an example taking an xml file from directory and convert it with JSON.stringify()
as in the example. Now is there a possibility instead of calling the local xml file (foo.xml), to call a url of XML service for ex: www.wunderground.com/city.ect/$data=xml
var parser = new xml2js.Parser();
parser.addListener('end', function(result) {
var res = JSON.stringify(result);
console.log('converted');
});
fs.readFile(__dirname + '/foo.xml', function(err, data) {
parser.parseString(data);
});