# xmlsonator

> high speed xml to json converter

Latest version **0.0.50** (published 2015-11-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install xmlsonator
pnpm add xmlsonator
yarn add xmlsonator
bun add xmlsonator
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.50 |
| Published | 2015-11-19 |
| First published | 2015-10-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 0 |
| Author | Andrew Zdenek |
| Maintainers | ajz01 |
| Keywords | xml, json, parser |

## Links

- npm: https://www.npmjs.com/package/xmlsonator
- Repository: https://github.com/ajz01/xmlsonator
- Homepage: https://github.com/ajz01/xmlsonator#readme
- Issues: https://github.com/ajz01/xmlsonator/issues
- npm.io page: https://npm.io/package/xmlsonator

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.0.50 (latest) — 2015-11-19
- 0.0.49 — 2015-11-19
- 0.0.48 — 2015-11-19
- 0.0.47 — 2015-11-15
- 0.0.46 — 2015-11-14
- 0.0.45 — 2015-11-13
- 0.0.44 — 2015-11-12
- 0.0.43 — 2015-11-12
- 0.0.42 — 2015-11-11
- 0.0.41 — 2015-11-11
- 0.0.40 — 2015-11-11
- 0.0.39 — 2015-11-11
- 0.0.38 — 2015-11-11
- 0.0.37 — 2015-11-11
- 0.0.36 — 2015-11-11
- … 35 more at https://npm.io/package/xmlsonator/versions

## README

# xmlsonator
A high speed xml to json converter built on libxml2.

Benchmark shows potentially 20 times faster than other popular xml to json packages.

# Usage
This project is just getting started so test your specific xml format before using.

There is only one method:

```javascript
Object = xmlsonator.toJson(Buffer);
```

## Example program with performance results

```javascript
var xsr = require('../build/Release/xmlsonator');

var xml = "<menu id='file' value='File'> \
  <popup> \
    <menuitem value='New' onclick='CreateNewDoc()' /> \
    <menuitem value='Open' onclick='OpenDoc()' /> \
    <menuitem value='Close' onclick='CloseDoc()' /> \
  </popup> \
</menu>";

var buffer = Buffer(xml, 'utf-8');

var n = 10000;

console.time(n + '-parses');

for(var i = 0; i < n; i++)
  var jobj = xsr.toJson(buffer);

console.timeEnd(n + '-parses');

console.log(jobj);
```

## Results
```
10000-parses: 479ms
{ menu: { id: 'file', value: 'File', popup: { menuitem: [Object] } } }
```

---
_Source: https://npm.io/package/xmlsonator · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
