xml-to-json

parse xml to json

node-xml-json

parse xml to json

npm install xml-to-json
var xml2json = require('xml-to-json')
 
xml2json({
    input: './sample/sample2.xml',
    output: './sample/test.json'
}, function(errresult) {
  
    if(err) {
        console.error(err);
    } else {
        console.log(result);
    }
  
});

In config object, you have to enter an input path. But If you don't want to output any file you can set to null.

MIT @chilijung