Esposter
    Preparing search index...

    Module @esposter/xml2js - v2.25.0

    @esposter/xml2js

    Apache-2.0 licensed NPM version NPM downloads NPM Unpacked Size (with version)

    Inspired by xml2js.

    A complete rewrite from CoffeeScript to TypeScript that removes unnecessary dependencies like events — resolving issues such as this.removeAllListeners is not a function. Retains all the options and behaviour of the original xml2js. Use parseStringPromise as the primary parsing API.


    pnpm i @esposter/xml2js
    

    We highly recommend you take a look at the documentation to level up.

    import { parseStringPromise } from "@esposter/xml2js";

    const xml = `<root><child attr="value">text</child></root>`;
    const result = await parseStringPromise(xml);
    // result: { root: { child: [ { _: 'text', $: { attr: 'value' } } ] } }

    The original package pulls in the events module which causes runtime errors in certain bundler/edge environments. This rewrite is a drop-in replacement that works cleanly in Node.js, Azure Functions, and browser bundles.

    This project is licensed under the Apache-2.0 license.

    Classes

    Builder
    Parser

    Variables

    BUILTIN_NAME_KEY
    DefaultBuilderOptions
    DefaultCommonOptions
    DefaultParserOptions
    TEXT_NODE_NAME

    Functions

    firstCharLowerCase
    normalize
    parseBooleans
    parseNumbers
    parseStringPromise
    stripBOM
    stripPrefix