Socket
Socket
Sign inDemoInstall

xml2json-light

Package Overview
Dependencies
0
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.2 to 1.0.3

15

package.json
{
"name": "xml2json-light",
"version": "1.0.2",
"description": "A very lightweight module that converts XML to JSON",
"main": "xml2json.min.js",
"version": "1.0.3",
"description": "This function acts as an XML to JSON converter. The function is extremely small and is in pure JavaScript, therefore it has no dependencies. The converter takes XML attributes into consideration. ## Installation ``` Download and use the function directly in your code!",
"main": "xml2json.js",
"scripts": {

@@ -14,9 +14,12 @@ "test": "echo \"Error: no test specified\" && exit 1"

"keywords": [
"xml2json-light",
"xml2json",
"xmltojson",
"javascript",
"xml",
"to",
"json",
"json",
"parser",
"light"
],
"author": "Samuel Bourgault (samuel@enkidootech.com)",
"author": "Enkidoo Technologies Inc.",
"license": "MIT",

@@ -23,0 +26,0 @@ "bugs": {

12

README.md

@@ -17,4 +17,5 @@ # xml2json

```javascript
var parser = require('xml2json-light');
var xml = ‘<person><name>John Doe</name></person>’;
var json = xml2json(xml);
var json = parser.xml2json(xml);

@@ -27,4 +28,5 @@ console.log(json);

```javascript
var parser = require('xml2json-light');
var xml = ‘<person id="1234"><name>John Doe</name></person>’;
var json = xml2json(xml);
var json = parser.xml2json(xml);

@@ -36,4 +38,5 @@ console.log(json);

```javascript
var parser = require('xml2json-light');
var xml = ‘<person id="1234" age="30"><name>John Doe</name></person>’;
var json = xml2json(xml);
var json = parser.xml2json(xml);

@@ -46,2 +49,3 @@ console.log(json);

```javascript
var parser = require('xml2json-light');
var xml = ‘<person id="1234">Something</person>’;

@@ -56,3 +60,3 @@

var json = xml2json(xml);
var json = parser.xml2json(xml);
console.log(json);

@@ -59,0 +63,0 @@ // prints ‘{"person": {"id": "1234", "_@ttribute": "Something"}}’

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc