CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-xml2json

Converts XML to JSON and vice-versa using node-expat parser

Overall
score

93%

Overview
Eval results
Files

task.mdevals/scenario-7/

XML Stream to JSON CLI

A small command-line wrapper that converts streaming XML input to JSON and exposes the converter version output.

Capabilities

Convert stdin XML to JSON

  • Running without flags reads UTF-8 XML from stdin, pipes it through the converter CLI, and writes compact JSON to stdout with exit code 0. @test
  • Passing --pretty formats the JSON with two-space indentation while preserving the structure from the converter. @test

Handle invalid XML

  • When stdin contains malformed XML, the tool exits with a non-zero status and writes a single-line error to stderr without emitting partial JSON. @test

Version passthrough

  • --version prints only the underlying converter's version string, skips reading stdin, and exits with status 0. @test

Implementation

@generates

API

export async function run(
  argv: string[],
  io?: {
    stdin?: NodeJS.ReadableStream;
    stdout?: NodeJS.WritableStream;
    stderr?: NodeJS.WritableStream;
  }
): Promise<number>;

Dependencies { .dependencies }

xml2json { .dependency }

Invoked as the XML-to-JSON command-line converter for stdin processing and version output.

Install with Tessl CLI

npx tessl i tessl/npm-xml2json

tile.json