@ebcom/xmlparser

1.2.0 • Public • Published

@ebcom/xml-parser

Fast and Simple XML Parser for parsing xml to json objects.

Installation

npm i @ebcom/xmlparser

How to use

const ebcomXmlParser = require('@ebcom/xmlparser');

//create an instance of parser with some options (if u want to use it globally in your project)
const parser = ebcomXmlParser({returnAttributeAsArray: true, throwErrorIfXmlNotValid: true});

const xml = `<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>`

const jsonObject = parser.parse(xml); //return a json object, simple as that :) 

Package Sidebar

Install

npm i @ebcom/xmlparser

Weekly Downloads

2

Version

1.2.0

License

MIT

Unpacked Size

5.63 kB

Total Files

8

Last publish

Collaborators

  • aliyarizadeh
  • armandolati
  • n.hashemi
  • alicpr
  • mahdiafzal
  • ahmadreza.salehvand