Reading XML file in Node.js Reading XML file in Node.js node.js node.js

Reading XML file in Node.js


use xml2json

https://www.npmjs.com/package/xml2json

fs = require('fs');var parser = require('xml2json');fs.readFile( './data.xml', function(err, data) {    var json = parser.toJson(data);    console.log("to json ->", json); });