Giter Site home page Giter Site logo

alexander-lee / fast-xml-parser Goto Github PK

View Code? Open in Web Editor NEW

This project forked from naturalintelligence/fast-xml-parser

0.0 1.0 0.0 5.63 MB

Validate XML, Parse XML and Build XML rapidly without C/C++ based libraries and no callback.

Home Page: https://naturalintelligence.github.io/fast-xml-parser/

License: MIT License

JavaScript 94.51% HTML 5.49%

fast-xml-parser's Introduction

Backers on Open Collective Sponsors on Open Collective Known Vulnerabilities NPM quality Coverage Status Try me NPM total downloads

Validate XML, Parse XML to JS Object, or Build XML from JS Object without C/C++ based libraries and no callback.

Looking for maintainers

Stubmatic donate button

Check ThankYouBackers for our contributors

Users

Check the list of all known users here;

The list of users is collected either from the list published by Github, cummunicated directly through mails/chat , or from other resources. If you feel that your name in the above list is incorrectly published or you're not the user of this library anymore then you can inform us to remove it. We'll do the necessary changes ASAP.

Main Features

FXP logo

  • Validate XML data syntactically
  • Parse XML to JS Object
  • Build XML from JS Object
  • Works with node packages, in browser, and in CLI (press try me button above for demo)
  • Faster than any pure JS implementation.
  • It can handle big files (tested up to 100mb).
  • Controlled parsing using various options
  • XML Entities, HTML entities, and DOCTYPE entites are supported.
  • unpaired tags (Eg <br> in HTML), stop nodes (Eg <script> in HTML) are supported.
  • You can restore almost same XML from JSON
  • Supports comments
  • It can preserve Order of tags in JS object
  • You can control if a single tag should be parsed into array.
  • Supports parsing of PI (Processing Instruction) tags with XML declaration tags
  • And many more other features.

How to use

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("../src/fxp");

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>

Check lib folder for different browser bundles

Bundle Name Size
fxbuilder.min.js 5.2K
fxparser.js 50K
fxparser.min.js 17K
fxp.min.js 22K
fxvalidator.min.js 5.7K

Documents

v3

v4

  1. GettingStarted.md
  2. XML Parser
  3. XML Builder
  4. XML Validator
  5. Entites
  6. HTML Document Parsing
  7. PI Tag processing

Performance

XML Parser

Large files

XML Builder

negative means error

Our other projects and research you must try

  • BigBit standard :
    • Single text encoding to replace UTF-8, UTF-16, UTF-32 and more with less memory.
    • Single Numeric datatype alternative of integer, float, double, long, decimal and more without precision loss.
  • Cytorus: Be specific and flexible while running E2E tests.
    • Run tests only for a particular User Story
    • Run tests for a route or from a route
    • Customizable reporting
    • Central dashboard for better monitoring
    • Options to integrate E2E tests with Jira, Github etc using Central dashboard Tian.
  • Stubmatic : Create fake webservices, DynamoDB or S3 servers, Manage fake/mock stub data, Or fake any HTTP(s) call.

Supporters

Contributors

This project exists thanks to all the people who contribute. [Contribute].

Backers

Thank you to all our backers! ๐Ÿ™ [Become a backer]

Sponsors

[Become a sponsor] Support this project by becoming a sponsor. Your logo will show up here with a link to your website. Please also share your detail so we can thankyou on SocialMedia.

License

  • MIT License

Donate $5

fast-xml-parser's People

Contributors

alfonsomunozpomer avatar amitguptagwl avatar bb avatar delagen avatar dependabot[bot] avatar gei0r avatar j0k3r avatar josep11 avatar kurtpreston avatar lplazas avatar lwestfall avatar massimo-ua avatar monkeywithacupcake avatar nhuethmayr avatar orgads avatar recca0120 avatar robhaj avatar serggonin avatar squitchyt avatar sverweij avatar tatsh avatar tdawgy avatar thedeathconqueror avatar tomasbruckner avatar tomldev avatar tomsseisums avatar trentshell avatar werehamster avatar zshare avatar zubb avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.