Skip to content

Latest commit

 

History

History
36 lines (25 loc) · 977 Bytes

1.GettingStarted.md

File metadata and controls

36 lines (25 loc) · 977 Bytes

Fast XML Parser is a javascript library to parse XML into JS Object, JSON or to build XML from JS Object without losing any information.

The aim of this library is to provide fast error free solution to deal with XML data format in javascript.

Setup

To use XML parser in your node js project

$ npm install fast-xml-parser

To use it as CLI to parse a XML file

$ npm install -g fast-xml-parser

To use it in Browser

  1. Include it in a script tag from some CDN

How to use

This documentation is based on how you can use FXP(fast-xml-parser) in node js.

const {XMLParser, XMLBuilder, XMLValidator} = require('fast-xml-parser');

if(XMLValidator.validate()){
    const parser = new XMLParser();
    let jsonObj = parser.parse(xmlData);
    
    const builder = new XMLBuilder();
    let samleXmlData = builder.build(jsonObj);
}

> Next: XmlParser