xml2json-node
v2.0.0
Published
Wrapper around Cheedoong's c++ xml2json library
Downloads
2
Readme
xml2json-node
Node wrapper around Cheedoong's c++ xml2json library with updated rapidjson and rapidxml libraries.
Inspired by this awesome, unmaintained, library: https://github.com/node-monk/xml-conv-json
Install
npm i xml2json-node
Example / API
const xml2json = require('xml2json-node')
const example = async () => {
const xmlString = `<person><name>Test</name><age>21</age></person>`
const jsonString = await xml2json(xmlString) // {"person":{"name":"Test","age":"21"}}
return JSON.parse(jsonString)
}
example() // { person: { name: 'Test', age: 21 } }