Clone and edit this document
Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
RunKit + npm: xml-js
node v4.9.1
endpoint
share
tweet
var convert = require('xml-js'); var xml = '<?xml version="1.0" encoding="utf-8"?>' + '<note importance="high" logged="true">' + ' <title>Happy</title>' + ' <todo>Work</todo>' + ' <todo>Play</todo>' + '</note>'; var result1 = convert.xml2json(xml, {compact: true, spaces: 4}); var result2 = convert.xml2json(xml, {compact: false, spaces: 4}); console.log(result1, '\n', result2);
Created from: https://runkit.com/npm/xml-js
Loading…
3 comments
posted
7 years ago
by
xujif
sws
posted
3 years ago
by
sukki
test
posted
3 years ago
by
pebatista84
test
sign in
to comment