JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 13
  • Score
    100M100P100Q52655F
  • License MIT

A high-performance native XML parser for React Native built with Kotlin and Objective-C using TurboModules and the New Architecture.

Package Exports

  • react-native-turboxml
  • react-native-turboxml/package.json

Readme

TurboXML – React Native XML Parser Logo

πŸš€ TurboXML – Fast XML Parser for React Native (TurboModules)

A blazing-fast, Android-native XML parser built for React Native’s New Architecture using Kotlin, JSI, and TurboModules.
4Γ— faster than react-native-xml2js in parsing large XML files.


⚑ Features

  • βœ… 4Γ— faster than react-native-xml2js
  • βœ… Native multithreaded XML parsing on Android
  • βœ… Powered by TurboModules + JSI (New Architecture support)
  • βœ… Lightweight and fully typed (TypeScript ready)
  • βœ… Designed for offline, map-heavy, or config-driven React Native apps

πŸ“¦ Installation

npm install react-native-turboxml
# or
yarn add react-native-turboxml

Make sure New Architecture is enabled:

cd ios && RCT_NEW_ARCH_ENABLED=1 pod install && cd ..

⚠️ Currently supports Android only. iOS support planned for future releases.


πŸ§ͺ Usage Example

import { useEffect, useState } from 'react';
import { Text, View, StyleSheet } from 'react-native';
import { parseXml } from 'react-native-turboxml';

export default function App() {
  const [parsedResult, setParsedResult] = useState<string | null>(null);

  useEffect(() => {
    const xml = `
      <config>
        <title>TurboXML</title>
        <enabled>true</enabled>
        <version>1.0</version>
      </config>
    `;

    parseXml(xml)
      .then((result) => {
        setParsedResult(JSON.stringify(result, null, 2));
      })
      .catch((error) => {
        setParsedResult(\`Error: \${error.message}\`);
      });
  }, []);

  return (
    <View style={styles.container}>
      <Text style={styles.title}>Parsed XML:</Text>
      <Text style={styles.output}>{parsedResult}</Text>
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    padding: 24,
    justifyContent: 'center',
  },
  title: {
    fontWeight: 'bold',
    marginBottom: 8,
  },
  output: {
    fontFamily: 'monospace',
  },
});

βœ… Example Output

{
  "config": {
    "title": ["TurboXML"],
    "enabled": ["true"],
    "version": ["1.0"]
  }
}

πŸš€ Why TurboXML?

If your app needs to parse large XML files β€” such as offline maps, configuration files, or external data feeds β€” react-native-turboxml offers a significant speed improvement over JavaScript-based parsers by leveraging native code, multithreading, and the React Native New Architecture (TurboModules + JSI).


πŸ›  Requirements

  • React Native 0.71+ with New Architecture enabled
  • Android 5+ (iOS support coming)
  • TurboModule + JSI support (enabled by default in modern RN projects)

πŸ“š API Reference

function parseXml(xml: string): Promise<Record<string, any>>;

πŸ™Œ Contribute or Sponsor

Got feature ideas or want to help bring iOS support? PRs welcome! If this module helps your app or workflow, consider starring the repo or reaching out.