RockPaperScissors/node_modules/xml2json/example.js
2021-12-02 17:22:41 +01:00

10 lines
260 B
JavaScript

var parser = require('./index');
// xml to json
var xml = "<foo attr=\"value\">bar</foo>";
console.log("input -> %s", xml)
var json = parser.toJson(xml);
console.log("to json -> %s", json);
var xml = parser.toXml(json);
console.log("back to xml -> %s", xml)