🚀 High-Performance XML Processing
Benchmarked XML parser optimized for speed and memory efficiency. Outperforms traditional DOM parsers for large XML files. See Performance Benchmarks
🚀 High-Performance XML Processing
Benchmarked XML parser optimized for speed and memory efficiency. Outperforms traditional DOM parsers for large XML files. See Performance Benchmarks
🔄 Streaming XML Parser
Memory-efficient stream-based parsing approach. Process XML files of any size without loading entire document into memory. Learn Streaming API
🌐 Universal JavaScript Compatibility
Works seamlessly in Node.js, Bun, Deno, and modern web browsers. Uses Web Standard APIs for maximum compatibility. Installation Guide
📝 TypeScript-First XML Parser
Built with TypeScript, providing comprehensive type definitions and IntelliSense support. Full type safety for XML parsing operations. TypeScript Examples
Choose your preferred package manager to install StAX-XML:
# npm - Most popular package managernpm install stax-xml # yarn - Fast, reliable package manageryarn add stax-xml # pnpm - Efficient disk space usagepnpm add stax-xml # bun - Ultra-fast JavaScript runtimebun add stax-xml # deno - Secure TypeScript runtimedeno add npm:stax-xmlPlatform Requirements:
Get started with StAX-XML in seconds. Here’s how to parse XML with streaming support:
import { StaxXmlParser, XmlEventType } from 'stax-xml'; // XML content to parseconst xmlContent = '<bookstore><book id="1"><title>JavaScript Guide</title></book></bookstore>'; // Create ReadableStream for streaming XML parsingconst stream = new ReadableStream({ start(controller) { controller.enqueue(new TextEncoder().encode(xmlContent)); controller.close(); }}); // Parse XML asynchronously with event-driven approachasync function parseXml() { const parser = new StaxXmlParser(stream); for await (const event of parser) { if (event.type === XmlEventType.START_ELEMENT) { console.log(`Found element: ${event.name}`); } }}parseXml();→ More Advanced Examples | → API Documentation
Unlike traditional XML-to-JSON mappers, StAX-XML provides pull-based parsing that gives you complete control over XML processing: