Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ecjson

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ecjson

Convert Xml to JSON Easily

  • 0.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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:


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:

<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,


{"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!"}
		}
	}
}


Keywords

FAQs

Package last updated on 22 Dec 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc