An open API service indexing awesome lists of open source software.

https://github.com/peterroe/xtj

Convert xml to javascript object
https://github.com/peterroe/xtj

javascript xml xml-parser xmltojson

Last synced: 11 months ago
JSON representation

Convert xml to javascript object

Awesome Lists containing this project

README

          

## XTJ

A tiny unit to convert xml to javascript object.



## Features

* `Typescript` support.
* `ESM` and `UMD` friendly.
* Tiny size.

## Install

```shell
$ npm install xtj
```

## Usage

```ts
import XmlToJs from 'xtj'

const str = `Successval1val2`

XmlToJs(str)

/* =>
{
"HTML": [
{
"HEAD": "",
},
{
"BODY": [
{
"MYROOT": [
{
"TEST": "Success",
},
{
"TEST2": [
{
"ITEM": "val1",
},
{
"ITEM": "val2",
},
],
},
],
},
],
},
],
}
*/
```