2.0.0 • Published 4 years ago

xml2json-node v2.0.0

Weekly downloads
2
License
ISC
Repository
-
Last release
4 years ago

xml2json-node

Node wrapper around Cheedoong's c++ xml2json library with updated rapidjson and rapidxml libraries.

travis

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 } }

C++ sources: