Validate XML, Parse XML and Build XML rapidly without C/C++ based libraries and no callback.
[![NPM quality][quality-image]][quality-url]
Validate XML, Parse XML to JS Object, or Build XML from JS Object without C/C++ based libraries and no callback.
I had recently published a book, The Power Glasses. Please have a look. Your feedback would be helpful. You can mail me for a free copy.
Sponsor this project
The list of users are mostly published by Github or communicated directly. Feel free to contact if you find any information wrong.
<br>
in HTML), stop nodes (Eg <script>
in HTML) are supported.I developed v5 in Apr 2023. And I didn’t get the chance to complete all the features. I’ve ensured that new features don’t impact performance. With v5, you have more control on parsing output. Check docs for syntax help and basic understanding.
Please leave a comment in discussion forum for your suggestions and if you really need v5.
To use as package dependency
$ npm install fast-xml-parser
or
$ yarn add fast-xml-parser
To use as system command
$ npm install fast-xml-parser -g
To use it on a webpage include it from a CDN
Example
As CLI command
$ fxparser some.xml
In a node js project
const { XMLParser, XMLBuilder, XMLValidator} = require("fast-xml-parser");
const parser = new XMLParser();
let jObj = parser.parse(XMLdata);
const builder = new XMLBuilder();
const xmlContent = builder.build(jObj);
In a HTML page
<script src="path/to/fxp.min.js"></script>
:
<script>
const parser = new fxparser.XMLParser();
parser.parse(xmlContent);
</script>
Bundle size
Bundle Name | Size |
---|---|
fxbuilder.min.js | 6.5K |
fxparser.min.js | 20K |
fxp.min.js | 26K |
fxvalidator.min.js | 5.7K |
v3 | v4 | v5 |
documents |
note: version 5 is released with version 4 tfor experimental use. Based on it’s demand, it’ll be developed and the features can be different in final release.
negative means error
Usage Trend of fast-xml-parser
This project exists thanks to all the people who contribute. [Contribute].
Thank you to all our backers! 🙏 [Become a backer]