Converts XML to JSON and vice-versa using node-expat parser
Overall
score
93%
Transforms XML payloads into JavaScript-safe JSON for downstream processing.
@generates
export type ArrayTags = string[] | boolean;
export interface XmlToJsonOptions {
asObject?: boolean;
arrayTags?: ArrayTags;
sanitize?: boolean;
textKey?: string;
coerce?: boolean;
}
export function xmlToJson(
xmlInput: string | Buffer,
options?: XmlToJsonOptions
): string | Record<string, unknown>;Used to convert XML input to JSON while handling JS-safe escaping, optional sanitization, and array coercion. @satisfied-by
Install with Tessl CLI
npx tessl i tessl/npm-xml2jsondocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10