xml2json-light
Advanced tools
Comparing version 1.0.2 to 1.0.3
{ | ||
"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": { |
@@ -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"}}’ |
13624
82