Registry / serialization / xml-parser

xml-parser

JSON →
library1.2.1jsnpmunverified

The `xml-parser` library (current version 1.2.1) is a lightweight, non-compliant XML parser designed for parsing basic XML responses, primarily as an alternative to heavier, compile-time-intensive XML libraries like `libxml`. Its core differentiator is its simplicity and minimal footprint, making it suitable for niche use cases where full XML specification adherence is not required. It focuses on quickly extracting data from well-known, simple XML structures rather than validating or comprehensively parsing complex or edge-case XML documents. The package has seen no updates in over six years, indicating it is no longer actively maintained and should be used with caution, understanding its limitations regarding XML standard compliance and potential security implications of unpatched vulnerabilities. It primarily targets Node.js environments.

serialization
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

This library is CommonJS-only and does not support ES module imports. The default export is the parsing function.

const parse = require('xml-parser');

Demonstrates parsing a sample SOAP XML response and pretty-printing the resulting JavaScript object structure.

const fs = require('fs'); const parse = require('xml-parser'); const inspect = require('util').inspect; // Simulate reading an XML file const xml = `<?xml version="1.0" encoding="utf-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="urn:enterprise.soap.sforce.com"> <soapenv:Body> <createResponse> <result> <id>003D000000OY9omIAD</id> <success>true</success> </result> <result> <id>001D000000HTK3aIAH</id> <success>true</success> </result> </createResponse> </soapenv:Body> </soapenv:Envelope>`; const obj = parse(xml); console.log(inspect(obj, { colors: true, depth: Infinity }));
Debug
Known footguns
gotchaThe parser is explicitly non-compliant with full XML specifications and is designed for basic, well-formed XML structures. It may not handle all valid XML features or edge cases correctly.
breakingThe `xml-parser` package is no longer actively maintained, with the last commit over six years ago. This means it will not receive updates for new features, bug fixes, or security vulnerabilities.
gotchaThe library is CommonJS-only and does not natively support ES module (`import`) syntax, which is standard in modern JavaScript projects.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
8 hits · last 30 days
gptbot
4
ahrefsbot
3
script
1
Resources