Node Express XML to JSON parsing

I am relatively new to node… I have xml2js module installed for converting XML to JSON. It works fine but i don’t know how to sent result from router to view.

   fs.readFile( './xmldata.xml', function(err, data) {
       parser.parseString(data, function (err, result) {
          console.log(JSON.stringify(result.root, null, 4));
       });
    });


Source: xml

Leave a Reply