Last active
January 2, 2020 01:47
-
-
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/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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