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
As the other poster points out, node-xmltojs is probably the best way to go.
If you did want to use JSONML, I'm not sure why the JQuery plugin in the other answer is being upvoted: there's JSONML for node:
npm install jsonml
Example:
var fs = require('fs'),
parse = require('jsonml').parse;
var jsonML = parse(fs.readFileSync('myfile.xml'));