{"name":"fast-xml-parser","version":"5.3.2","keywords":["fast","xml","json","parser","xml2js","x2js","xml2json","js","validator","validate","transformer","assert","js2xml","json2xml","html"],"author":{"url":"https://solothought.com","name":"Amit Gupta"},"license":"MIT","_id":"fast-xml-parser@5.3.2","maintainers":[{"name":"amitgupta","email":"amitgupta.gwl@gmail.com"}],"homepage":"https://github.com/NaturalIntelligence/fast-xml-parser#readme","bugs":{"url":"https://github.com/NaturalIntelligence/fast-xml-parser/issues"},"bin":{"fxparser":"src/cli/cli.js"},"dist":{"shasum":"78a51945fbf7312e1ff6726cb173f515b4ea11d8","tarball":"http://registry-npm.ywwl.com/fast-xml-parser/download/fast-xml-parser-5.3.2.tgz","fileCount":55,"integrity":"sha512-n8v8b6p4Z1sMgqRmqLJm3awW4NX7NkaKPfb3uJIBTSH7Pdvufi3PQ3/lJLQrvxcMYl7JI2jnDO90siPEpD8JBA==","signatures":[{"sig":"MEUCIQDAU4C9FG/txHT2eWN7ckxnO4fUTIP+o0oqj9GXBQewpgIgfr4TBUBn4P0Rx1J+fxsDvW2Ioajt1idgzafT5lKTjVc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":586602,"size":155821,"noattachment":false,"key":"/fast-xml-parser/-/fast-xml-parser-5.3.2.tgz"},"main":"./lib/fxp.cjs","type":"module","types":"./src/fxp.d.ts","module":"./src/fxp.js","exports":{".":{"import":{"types":"./src/fxp.d.ts","default":"./src/fxp.js"},"require":{"types":"./lib/fxp.d.cts","default":"./lib/fxp.cjs"}}},"funding":[{"url":"https://github.com/sponsors/NaturalIntelligence","type":"github"}],"gitHead":"e0769f20cfbb67037e2db691401c71f9e101c547","scripts":{"lint":"eslint src/**/*.js spec/**/*.js benchmark/**/*.js","perf":"node ./benchmark/perfTest3.js","test":"c8 --reporter=lcov --reporter=text jasmine spec/*spec.js","unit":"jasmine","bundle":"webpack --config webpack.cjs.config.js","coverage":"nyc report --reporter html --reporter text -t .nyc_output --report-dir .nyc_output/summary","prettier":"prettier --write src/**/*.js","test-types":"tsc --noEmit spec/typings/typings-test.ts","checkReadiness":"publish-please --dry-run"},"_npmUser":{"name":"amitgupta","email":"amitgupta.gwl@gmail.com"},"repository":{"url":"git+https://github.com/NaturalIntelligence/fast-xml-parser.git","type":"git"},"_npmVersion":"10.9.2","description":"Validate XML, Parse XML, Build XML without C/C++ based libraries","directories":{},"sideEffects":false,"_nodeVersion":"22.14.0","dependencies":{"strnum":"^2.1.0"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^10.1.3","he":"^1.2.0","eslint":"^8.3.0","jasmine":"^5.6.0","webpack":"^5.64.4","prettier":"^3.5.1","typescript":"5","@babel/core":"^7.13.10","@types/node":"20","webpack-cli":"^4.9.1","babel-loader":"^8.2.2","publish-please":"^5.5.2","@babel/register":"^7.13.8","@babel/preset-env":"^7.13.10","@babel/plugin-transform-runtime":"^7.13.10"},"_npmOperationalInternal":{"tmp":"tmp/fast-xml-parser_5.3.2_1763112493146_0.43816038260364376","host":"s3://npm-registry-packages-npm-production"},"readme":"# [fast-xml-parser](https://www.npmjs.com/package/fast-xml-parser)\n\n[![NPM total downloads](https://img.shields.io/npm/dt/fast-xml-parser.svg)](https://npm.im/fast-xml-parser)\n\nValidate XML, Parse XML to JS Object, or Build XML from JS Object without C/C++ based libraries and no callback.\n\n<img align=\"right\" src=\"static/img/fxp_logo.png\" width=\"180px\" alt=\"FXP logo\"/>\n\n* Validate XML data syntactically. Use [detailed-xml-validator](https://github.com/NaturalIntelligence/detailed-xml-validator/) to verify business rules.\n* Parse XML to JS Objects and vice versa\n* Common JS, ESM, and browser compatible\n* Faster than any other pure JS implementation.\n\nIt can handle big files (tested up to 100mb). XML Entities, HTML entities, and DOCTYPE entites are supported. Unpaired tags (Eg `<br>` in HTML), stop nodes (Eg `<script>` in HTML) are supported. It can also preserve Order of tags in JS object\n\n> **IMPORTANT**: It is recommended to use [fast-xml-validator](https://github.com/NaturalIntelligence/fast-xml-validator) instead of inbuilt validator.\n\n# Before using this library\n\n- [Flexible-XML-Parser](https://github.com/nodable/flexible-xml-parser) is 1.25 times faster than this library when not preserving order of tags. Takes less memory when processing big files. Supports incomplete XML/HTML. And output is highly customizable. Build whatever you want. So if you're fine with some extra configuration then try it out.\n- [@nodable/sax](https://github.com/nodable/sax) is a SAX parser based on [Flexible-XML-Parser](https://github.com/nodable/flexible-xml-parser). 3-4 times faster than `sax`  and support all features of base package like incomplete input, streams, skipping certain tags from processing etc.\n- [fast-xml-validator](https://github.com/NaturalIntelligence/fast-xml-validator) is separated from this package. Has many features. Faster. You can exvlude particular tag from validation. And much more.\n- [fast-xml-builder](https://github.com/NaturalIntelligence/fast-xml-builder) is a XML to JS Object builder used in this package in past. Now, it supports more features, and faster. So, recommend to use it directly.\n\n\n---\n# Your Support, Our Motivation\n\nPlease join [Discord community](https://discord.gg/X4Qp9u6Vz) for pre release announcements and discussions.\n\n<!-- ## Try out our New Thoughts\n\n- WishIn - You need it if negative thoughts take over all the time <br>\n<a href=\"https://play.google.com/store/apps/details?id=com.solothought.wishin\"> <img src=\"https://solothought.com/products/assets/images/wishin/YouTubeThumbnail.png\" width=\"500px\"/> </a>\n- [Text2Chart](https://solothought.com/text2chart/flow): interactive flow chart out of simple text. -->\n\n## Financial Support\n\nSponsor this project\n\n<a href=\"https://github.com/sponsors/NaturalIntelligence\"> \n  <img src=\"https://raw.githubusercontent.com/NaturalIntelligence/ThankYouBackers/main/github_sponsor.png\" width=\"180\" />\n</a>\n<a href=\"https://opencollective.com/fast-xml-parser/donate\" target=\"_blank\">\n  <img src=\"https://opencollective.com/fast-xml-parser/donate/button@2x.png?color=blue\" width=180 />\n</a>\n<br>\n<br>\n<br>\n\n> This is a donation. No goods or services are expected in return. Any requests for refunds for those purposes will be rejected.\n\n## Users\n\n<a href=\"https://github.com/renovatebot/renovate\" title=\"renovate\" ><img src=\"https://avatars1.githubusercontent.com/u/38656520\" width=\"60px\" ></a>\n<a href=\"https://vmware.com/\" title=\"vmware\" > <img src=\"https://avatars0.githubusercontent.com/u/473334\" width=\"60px\" ></a>\n<a href=\"https://opensource.microsoft.com/\" title=\"microsoft\" > <img src=\"https://avatars0.githubusercontent.com/u/6154722\" width=\"60px\" ></a>\n<a href=\"http://ibm.github.io/\" title=\"IBM\" > <img src=\"https://avatars2.githubusercontent.com/u/1459110\" width=\"60px\" ></a>\n<a href=\"http://www.smartbear.com\" title=\"SmartBear Software\" > <img src=\"https://avatars2.githubusercontent.com/u/1644671\" width=\"60px\" ></a>\n<a href=\"http://nasa.github.io/\" title=\"NASA\" > <img src=\"https://avatars0.githubusercontent.com/u/848102\" width=\"60px\" ></a>\n<a href=\"https://github.com/prettier\" title=\"Prettier\" > <img src=\"https://avatars0.githubusercontent.com/u/25822731\" width=\"60px\" ></a>\n<a href=\"http://brain.js.org/\" title=\"brain.js\" > <img src=\"https://avatars2.githubusercontent.com/u/23732838\" width=\"60px\" ></a>\n<a href=\"https://github.com/aws\" title=\"AWS SDK\" > <img src=\"https://avatars.githubusercontent.com/u/2232217\" width=\"60px\" ></a>\n<a href=\"http://www.fda.gov/\" title=\"Food and Drug Administration \" > <img src=\"https://avatars2.githubusercontent.com/u/6471964\" width=\"60px\" ></a>\n<a href=\"http://www.magento.com/\" title=\"Magento\" > <img src=\"https://avatars2.githubusercontent.com/u/168457\" width=\"60px\" ></a>\n<a href=\"https://github.com/SAP\" title=\"SAP\" > <img src=\"https://user-images.githubusercontent.com/7692328/204835214-d9d25b58-e3df-408d-87a3-c7d36b578ee4.png\" width=\"60px\" ></a>\n<a href=\"https://github.com/postmanlabs\" title=\"postman\" > <img src=\"https://user-images.githubusercontent.com/7692328/204835529-e9e290ad-696a-49ad-9d34-08e955704715.png\" width=\"60px\" ></a>\n<a href=\"https://github.com/react-native-community\" title=\"React Native Community\" > <img src=\"https://avatars.githubusercontent.com/u/20269980?v=4\" width=\"60px\" ></a>\n<a href=\"https://github.com/googleapis\" title=\"Google APIs\" > <img src=\"https://avatars.githubusercontent.com/u/16785467?v=4\" width=\"60px\" ></a>\n<a href=\"https://github.com/langchain-ai\" title=\"Langchain AI\" > <img src=\"https://avatars.githubusercontent.com/u/126733545?v=4\" width=\"60px\" ></a>\n<a href=\"https://github.com/withastro\" title=\"Astro websie builder\" > <img src=\"https://avatars.githubusercontent.com/u/44914786?v=4\" width=\"60px\" ></a>\n<a href=\"https://github.com/baidu\" title=\"Baidu\" > <img src=\"https://avatars.githubusercontent.com/u/13245940?v=4\" width=\"60px\" ></a>\n[more](./USERs.md)\n\n<small>The list of users are mostly published by Github or communicated directly. Feel free to contact if you find any information wrong.</small>\n\n---\n\n# More about this library\n\n## How to use\n\nTo use as package dependency\n`$ npm install fast-xml-parser` \nor \n`$ yarn add fast-xml-parser`\n\nTo use as system command\n`$ npm install fast-xml-parser -g` \n\nTo use it on a **webpage** include it from a [CDN](https://cdnjs.com/libraries/fast-xml-parser)\n\n**Example**\n\nAs CLI command\n```bash\n$ fxparser some.xml\n```\n\nIn a node js project\n```js\nconst { XMLParser, XMLBuilder, XMLValidator} = require(\"fast-xml-parser\");\n\nconst parser = new XMLParser();\nlet jObj = parser.parse(XMLdata);\n\nconst builder = new XMLBuilder();\nconst xmlContent = builder.build(jObj);\n```\n\nIn a HTML page\n```html\n<script src=\"path/to/fxp.min.js\"></script>\n:\n<script>\n  const parser = new fxparser.XMLParser();\n  parser.parse(xmlContent);\n</script>\n```\n\nBundle size\n\n| Bundle Name        | Size |\n| ------------------ | ---- |\n| fxbuilder.min.js   | 6.5K |\n| fxparser.min.js    | 20K  |\n| fxp.min.js         | 26K  |\n| fxvalidator.min.js | 5.7K |\n\n## Documents\n<table>\n  <tr><td>v3</td><td>v4 and v5</td><td>v6</td></tr>\n  <tr>\n    <td>\n      <a href=\"./docs/v3/docs.md\">documents</a>\n    </td>\n    <td><ol>\n      <li><a href=\"./docs/v4,v5/1.GettingStarted.md\">Getting Started</a></li>\n      <li><a href=\"./docs/v4,v5/2.XMLparseOptions.md\">XML Parser</a></li>\n      <li><a href=\"./docs/v4,v5/3.XMLBuilder.md\">XML Builder</a></li>\n      <li><a href=\"./docs/v4,v5/4.XMLValidator.md\">XML Validator</a></li>\n      <li><a href=\"./docs/v4,v5/5.Entities.md\">Entities</a></li>\n      <li><a href=\"./docs/v4,v5/6.HTMLParsing.md\">HTML Document Parsing</a></li>\n      <li><a href=\"./docs/v4,v5/7.PITags.md\">PI Tag processing</a></li>\n      <li><a href=\"./docs/v4,v5/8.PathExpression.md\">Path Expression</a></li>\n    </ol></td>\n    <td><ol>\n      <li></li><a href=\"./docs/v6/1.GettingStarted.md\">Getting Started</a></li>\n    </ol></td>\n  </tr>\n</table>\n\n**note**: \n- Version 6 is released with version 4 for experimental use. Based on its demand, it'll be developed and the features can be different in final release.\n- Version 5 has the same functionalities as version 4.\n\n## Performance\n<small>negative means error</small>\n\n### XML Parser\n\n<img align=\"left\" src=\"./docs/imgs/XMLParser_v4.png\" width=\"45%\" />\n<img src=\"./docs/imgs/XMLParser_large_v4.png\" width=\"47%\" />\n\n* Y-axis: requests per second\n* X-axis: File size\n\n### XML Builder\n\n<img src=\"./docs/imgs/XMLBuilder_v4.png\" width=\"50%\" />\n* Y-axis: requests per second\n\n<!-- [![](static/img/ni_ads_ads.gif)](https://github.com/NaturalIntelligence/ads/) -->\n\n---\n\n## Usage Trend\n\n[Usage Trend of fast-xml-parser](https://npm-compare.com/fast-xml-parser#timeRange=THREE_YEARS)\n  \n<a href=\"https://npm-compare.com/fast-xml-parser#timeRange=THREE_YEARS\" target=\"_blank\">\n  <img src=\"https://npm-compare.com/img/npm-trend/THREE_YEARS/fast-xml-parser.png\" width=\"50%\" alt=\"NPM Usage Trend of fast-xml-parser\" />\n</a>\n\n# Supporters\n#### Contributors\n\nThis project exists thanks to [all](graphs/contributors) the people who contribute. [[Contribute](docs/CONTRIBUTING.md)].\n\n<a href=\"graphs/contributors\"><img src=\"https://opencollective.com/fast-xml-parser/contributors.svg?width=890&button=false\" /></a>\n\n\n#### Backers from Open collective\n\nThank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/fast-xml-parser#backer)]\n\n<a href=\"https://opencollective.com/fast-xml-parser#backers\" target=\"_blank\"><img src=\"https://opencollective.com/fast-xml-parser/backers.svg?width=890\"></a>\n\n\n\n# License\n* MIT License\n\n![Donate $5](static/img/donation_quote.png)\n","publish_time":1763112493363,"_cnpm_publish_time":1763112493363,"dist-tags":{"latest":"5.12.1","legacy":"4.5.7"}}