I\'ve installed node-xml but I don\'t think it works the way I expect. and it doesnt\' have example. any recommendation for xml-2-json (js) for node.js? I also looked a
To convert XML to JSON in Node js, you can use xml2json package.
To install the package:- npm install --save xml2json
Add Code snippet:-
var parser = require('xml2json');
var xml = "bar ";
console.log("input -> %s", xml)
// xml to json
var json = parser.toJson(xml);
console.log("to json -> %s", json);
For more details please visit:- xml2json