# ecjson

> Convert Xml to JSON Easily

Latest version **0.1.2** (published 2014-12-22) · ISC license · 0 weekly downloads

## Install

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

## 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.1.2 |
| Published | 2014-12-22 |
| First published | 2014-12-18 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+16 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Balakrishnan |
| Maintainers | srbkrishnan |
| Keywords | xml, json, parse, converter |

## Links

- npm: https://www.npmjs.com/package/ecjson
- Repository: https://github.com/srbkrishnan/ecjson
- Issues: https://github.com/srbkrishnan/ecjson/issues
- npm.io page: https://npm.io/package/ecjson

## Dependencies (1)

- [xmldom](https://npm.io/package/xmldom.md) latest

## 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.1.2 (latest) — 2014-12-22
- 0.1.1 — 2014-12-22
- 0.1.0 — 2014-12-22
- 0.0.9 — 2014-12-19
- 0.0.8 — 2014-12-18
- 0.0.7 — 2014-12-18
- 0.0.6 — 2014-12-18
- 0.0.5 — 2014-12-18
- 0.0.4 — 2014-12-18
- 0.0.3 — 2014-12-18

## README

A combination of parser and Json Converter to get Json objects from XML. It is similar to xml2js but its simple.

Install:
-------
>npm install ecjson

Example:
====
```javascript

var ecjson=require('ecjson');

 ecjson.XmlToJson("<root>Hello</root>", function (JsonData) {
                  console.log(JsonData);
              });
````

Convert Complex XML to Json easily. All the Attributes of any element will be given as the data-members in json.

For Example, the xml:

````xml
<messages>
	<note ID="501">
		<to sendAs="email">Maxwell</to>
		<from>Annabelle</from>
		<heading style="Font:'Calibri'">Reminder</heading>
		<body>Don't forget me this weekend!</body>
	</note>
</messages>
````
will be converted as,

````javascript

{"messages":
	{"note":
		{
		"ID":"501",
		"to":
			{"sendAs":"email",
			"value":"Maxwell"},
		"from":
			{"value":"Annabelle"},
		"heading":
			{"style":"Font:'Calibri'",
			"value":"Reminder"},
		"body":
			{"value":"Don't forget me this weekend!"}
		}
	}
}


````

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