{"name":"fast-xml-parser","version":"4.5.1","description":"Validate XML, Parse XML, Build XML without C/C++ based libraries","main":"./src/fxp.js","scripts":{"test":"nyc --reporter=lcov --reporter=text jasmine spec/*spec.js","test-types":"tsc --noEmit spec/typings/typings-test.ts","unit":"jasmine","coverage":"nyc report --reporter html --reporter text -t .nyc_output --report-dir .nyc_output/summary","perf":"node ./benchmark/perfTest3.js","lint":"eslint src/*.js spec/*.js","bundle":"webpack --config webpack-prod.config.js","prettier":"prettier --write src/**/*.js","publish-please":"publish-please","checkReadiness":"publish-please --dry-run"},"bin":{"fxparser":"src/cli/cli.js"},"repository":{"type":"git","url":"git+https://github.com/NaturalIntelligence/fast-xml-parser.git"},"keywords":["fast","xml","json","parser","xml2js","x2js","xml2json","js","cli","validator","validate","transformer","assert","js2xml","json2xml","html"],"author":{"name":"Amit Gupta","url":"https://solothought.com"},"license":"MIT","devDependencies":{"@babel/core":"^7.13.10","@babel/plugin-transform-runtime":"^7.13.10","@babel/preset-env":"^7.13.10","@babel/register":"^7.13.8","@types/node":"20","babel-loader":"^8.2.2","eslint":"^8.3.0","he":"^1.2.0","jasmine":"^3.6.4","nyc":"^15.1.0","prettier":"^1.19.1","publish-please":"^5.5.2","typescript":"5","webpack":"^5.64.4","webpack-cli":"^4.9.1"},"typings":"src/fxp.d.ts","funding":[{"type":"github","url":"https://github.com/sponsors/NaturalIntelligence"},{"type":"paypal","url":"https://paypal.me/naturalintelligence"}],"dependencies":{"strnum":"^1.0.5"},"_id":"fast-xml-parser@4.5.1","gitHead":"e132656533533886f7dc9eadbd8e790ae5572b4c","bugs":{"url":"https://github.com/NaturalIntelligence/fast-xml-parser/issues"},"homepage":"https://github.com/NaturalIntelligence/fast-xml-parser#readme","_nodeVersion":"22.11.0","_npmVersion":"10.9.0","dist":{"integrity":"sha512-y655CeyUQ+jj7KBbYMc4FG01V8ZQqjN+gDYGJ50RtfsUB8iG9AmwmwoAgeKLJdmueKKMrH1RJ7yXHTSoczdv5w==","shasum":"a7e665ff79b7919100a5202f23984b6150f9b31e","tarball":"http://registry-npm.ywwl.com/fast-xml-parser/download/fast-xml-parser-4.5.1.tgz","fileCount":45,"unpackedSize":173955,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFkOxpfUcdBxnjYU+wFkI6To395h2Ea5s8I/Qx9I+EmnAiEAohyJVQTDNxlLcrfIPNI6gvxGfXrw+mRkQeCPHYX34pM="}],"size":44909,"noattachment":false,"key":"/fast-xml-parser/-/fast-xml-parser-4.5.1.tgz"},"_npmUser":{"name":"amitgupta","email":"amitgupta.gwl@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/fast-xml-parser_4.5.1_1734246943712_0.968589544310589"},"_hasShrinkwrap":false,"readme":"# [fast-xml-parser](https://www.npmjs.com/package/fast-xml-parser)\n[![NPM quality][quality-image]][quality-url]\n[![Coverage Status](https://coveralls.io/repos/github/NaturalIntelligence/fast-xml-parser/badge.svg?branch=master)](https://coveralls.io/github/NaturalIntelligence/fast-xml-parser?branch=master)\n[<img src=\"https://img.shields.io/badge/Try-me-blue.svg?colorA=FFA500&colorB=0000FF\" alt=\"Try me\"/>](https://naturalintelligence.github.io/fast-xml-parser/)\n[![NPM total downloads](https://img.shields.io/npm/dt/fast-xml-parser.svg)](https://npm.im/fast-xml-parser)\n\n\nValidate XML, Parse XML to JS Object, or Build XML from JS Object without C/C++ based libraries and no callback.\n\n---\n\n<a href=\"https://www.amazon.in/Power-Glasses-world-imagination-Perspective-ebook/dp/B0CW1CJGNK/\"><img align=\"left\" src=\"https://github.com/NaturalIntelligence/fast-xml-parser/assets/7692328/e7a42bcc-5186-45e3-bfee-de8d8b9a69d4\" alt=\"ads-thePowerGlassesBook\"/></a>\nI had recently published a book, The Power Glasses. Please have a look. Your feedback would be helpful. You can [mail](githubissues@proton.me) me for a free copy.\n<br>\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<a href=\"https://paypal.me/naturalintelligence\"> <img src=\"static/img/support_paypal.svg\" alt=\"donate button\" width=\"180\"/></a>\n<br>\n<br>\n<br>\n\n<!--\n### Current Sponsors\n\nCheck the complete list at [ThankYouBackers](https://github.com/NaturalIntelligence/ThankYouBackers) for our sponsors and supporters.\n\nThrough Github\n\n<a href=\"https://github.com/skunkteam\" target=\"_blank\"><img src=\"https://avatars.githubusercontent.com/u/46373671?s=60\" width=\"60px\"></a>\n<a href=\"https://github.com/getsentry\" target=\"_blank\"><img src=\"https://avatars.githubusercontent.com/u/1396951?s=60\" width=\"60px\"></a>\n\nThrough OpenCollective\n\n<a href=\"https://opencollective.com/fast-xml-parser/sponsor/0/website\" target=\"_blank\"><img src=\"https://opencollective.com/fast-xml-parser/sponsor/0/avatar.svg\"></a>\n<a href=\"https://opencollective.com/fast-xml-parser/sponsor/1/website\" target=\"_blank\"><img src=\"https://opencollective.com/fast-xml-parser/sponsor/1/avatar.svg\"></a>\n<a href=\"https://opencollective.com/fast-xml-parser/sponsor/2/website\" target=\"_blank\"><img src=\"https://opencollective.com/fast-xml-parser/sponsor/2/avatar.svg\"></a>\n<a href=\"https://opencollective.com/fast-xml-parser/sponsor/3/website\" target=\"_blank\"><img src=\"https://opencollective.com/fast-xml-parser/sponsor/3/avatar.svg\"></a>\n<a href=\"https://opencollective.com/fast-xml-parser/sponsor/4/website\" target=\"_blank\"><img src=\"https://opencollective.com/fast-xml-parser/sponsor/4/avatar.svg\"></a>\n<a href=\"https://opencollective.com/fast-xml-parser/sponsor/5/website\" target=\"_blank\"><img src=\"https://opencollective.com/fast-xml-parser/sponsor/5/avatar.svg\"></a>\n<a href=\"https://opencollective.com/fast-xml-parser/sponsor/6/website\" target=\"_blank\"><img src=\"https://opencollective.com/fast-xml-parser/sponsor/6/avatar.svg\"></a>\n<a href=\"https://opencollective.com/fast-xml-parser/sponsor/7/website\" target=\"_blank\"><img src=\"https://opencollective.com/fast-xml-parser/sponsor/7/avatar.svg\"></a>\n<a href=\"https://opencollective.com/fast-xml-parser/sponsor/8/website\" target=\"_blank\"><img src=\"https://opencollective.com/fast-xml-parser/sponsor/8/avatar.svg\"></a>\n<a href=\"https://opencollective.com/fast-xml-parser/sponsor/9/website\" target=\"_blank\"><img src=\"https://opencollective.com/fast-xml-parser/sponsor/9/avatar.svg\"></a>\n-->\n\n![fxp_sponsors](https://raw.githubusercontent.com/NaturalIntelligence/ThankYouBackers/main/assets/NI_sponsors.jpg)\n<a href=\"https://github.com/cocopon\" target=\"_blank\">Hiroki Kokubun</a>\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## Main Features\n\n<img align=\"right\" src=\"static/img/fxp_logo.png\" width=\"180px\" alt=\"FXP logo\"/>\n\n* Validate XML data syntactically\n* Parse XML to JS Object\n* Build XML from JS Object\n* Compatible to node js packages, in browser, and in CLI (click try me button above for demo)\n* Faster than any other pure JS implementation.\n* It can handle big files (tested up to 100mb).\n* Controlled parsing using various options\n* XML Entities, HTML entities, and DOCTYPE entites are supported.\n* unpaired tags (Eg `<br>` in HTML), stop nodes (Eg `<script>` in HTML) are supported.\n* You can restore almost same XML from JSON\n* Supports comments\n* It can preserve Order of tags in JS object\n* You can control if a single tag should be parsed into array.\n* Supports parsing of PI (Processing Instruction) tags with XML declaration tags\n* And many more other features.\n\n## v5\nI 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](./docs/v5) for syntax help and basic understanding.\n\nPlease leave a comment in discussion forum for your suggestions and if you really need v5.\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</td><td>v5</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/1.GettingStarted.md\">Getting Started</a></li>\n      <li><a href=\"./docs/v4/2.XMLparseOptions.md\">XML Parser</a></li>\n      <li><a href=\"./docs/v4/3.XMLBuilder.md\">XML Builder</a></li>\n      <li><a href=\"./docs/v4/4.XMLValidator.md\">XML Validator</a></li>\n      <li><a href=\"./docs/v4/5.Entities.md\">Entities</a></li>\n      <li><a href=\"./docs/v4/6.HTMLParsing.md\">HTML Document Parsing</a></li>\n      <li><a href=\"./docs/v4/7.PITags.md\">PI Tag processing</a></li>\n    </ol></td>\n    <td><ol>\n      <li></li><a href=\"./docs/v5/1.GettingStarted.md\">Getting Started</a></li>\n      <li><a href=\"./docs/v5/2.Features.md\">Features</a></li>\n      <li><a href=\"./docs/v5/3.Options.md\">Options</a></li>\n      <li><a href=\"./docs/v5/4.OutputBuilders.md\">Output Builders</a></li>\n      <li><a href=\"./docs/v5/5.ValueParsers.md\">Value Parsers</a></li>\n    </ol></td>\n  </tr>\n</table>\n\n**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.\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\n\n<!-- [![](static/img/ni_ads_ads.gif)](https://github.com/NaturalIntelligence/ads/) -->\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<!-- <a href=\"graphs/contributors\"><img src=\"https://opencollective.com/fast-xml-parser/contributors.svg?width=890&button=false\" /></a> -->\n<!--\n### Lead Maintainers\n![Amit Gupta](https://avatars1.githubusercontent.com/u/7692328?s=100&v=4)\n[![Vohmyanin Sergey Vasilevich](https://avatars3.githubusercontent.com/u/783335?s=100&v=4)](https://github.com/Delagen)\n\n### All Contributors -->\n<a href=\"graphs/contributors\"><img src=\"https://opencollective.com/fast-xml-parser/contributors.svg?width=890&button=false\" /></a>\n\n### Backers\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":1734246943916,"maintainers":[{"name":"amitgupta","email":"amitgupta.gwl@gmail.com"}],"_cnpm_publish_time":1734246943916,"dist-tags":{"latest":"5.12.1","legacy":"4.5.7"}}