Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
NodeJS XML to JSON using XML2JS
const xml2js = require('xml2js');
const xml = '<root>Hello world!</root>'
xml2js.parseString(xml, function (err, result) {
console.log(result.root); // Output: Hello world!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment