xml2js is a Node.js module that converts XML into JavaScript objects (and vice versa). It simplifies XML parsing by using pure JavaScript and supports both synchronous and asynchronous parsing. It’s a lightweight alternative to heavy DOM parsers. You can create one xml2js.Parser per file. That's the recommended one and is promised to always just work. You can call reset() on your parser object. You can hope everything goes well anyway. This behaviour is not guaranteed to work always, if ever.
Features
- Converts XML to JavaScript object structures
- Supports bi‑directional conversion (XML ↔ JavaScript/JSON)
- Offers both async and sync parsing methods
- Built on sax-js parser and xmlbuilder-js for object building
- Handles XML attributes, nested elements, and arrays naturally
- Lightweight and easy to integrate into Node.js projects
Categories
XMLLicense
MIT LicenseFollow xml2js
Other Useful Business Software
Gen AI apps are built with MongoDB Atlas
MongoDB Atlas is the developer-friendly database used to build, scale, and run gen AI and LLM-powered apps—without needing a separate vector database. Atlas offers built-in vector search, global availability across 115+ regions, and flexible document modeling. Start building AI apps faster, all in one place.
Rate This Project
Login To Rate This Project
User Reviews
Be the first to post a review of xml2js!