Skip to content

Instantly share code, notes, and snippets.

@AbuzerAsif
Last active January 2, 2020 01:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AbuzerAsif/d2c1d65c07e2eb40021d328fd8c89958 to your computer and use it in GitHub Desktop.
Save AbuzerAsif/d2c1d65c07e2eb40021d328fd8c89958 to your computer and use it in GitHub Desktop.
NodeJS XML to JSON using XML2JS https://embarkcode.com/nodejs-xml-to-json/
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