Skip to content

Latest commit

 

History

History
34 lines (28 loc) · 470 Bytes

README.md

File metadata and controls

34 lines (28 loc) · 470 Bytes

xml2json

XML to JSON

Install dependcies (for test)

$ yarn or $ npm install

Run parser

In order to run an example: $ yarn start or $ npm start

Test parser

$ yarn test or $ npm run test

Example

  const xmlParser = require('./src/parser');
  const xml = '<person><name>Carlos</name><lastname>Linares</lastname></person>';

  xmlParser.parse(xml);

Output

{
  person: {
    name: 'Carlos',
    lastname: 'Linares'
  }
}