1.0.8 • Published 3 years ago

xml-json-format v1.0.8

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

xml-json-format

Installation

USAGE

Run npm install --save xml-json-format

const toJSON = require('xml-json-format')

const xml = 
'<?xml version="1.0" encoding="utf-8"?>' +
'<note importance="high" logged="true">' +
'    <title>Happy</title>' +
'    <todo>Work</todo>' +
'    <todo>Play</todo>' +
'</note>';

const jsonResult = toJSON(xml);

console.log(jsonResult);

/* expected: {
    "_declaration": {
        "_attributes": {
            "version": "1.0",
            "encoding": "utf-8"
        }
    },
    "note": {
        "_attributes": {
            "importance": "high",
            "logged": "true"
        },
        "title": "Happy",
        "todo": [
            "Work",
            "Play"
        ]
    }
} */
1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago