Skip to content

Latest commit

 

History

History
15 lines (10 loc) · 404 Bytes

README.md

File metadata and controls

15 lines (10 loc) · 404 Bytes

XML (xml2json, json2xml)

import { XML } from "https://js.sabae.cc/XML.js";

const json = XML.toJSON("<xml att='abc'><tag>text</tag></xml>");
console.log(json); // { xml: { att: "abc", tag: { "#text": "text" } } }

const xml = XML.stringify({ xml: { att: "abc", tag: { "#text": "text" } } });
console.log(xml);

dependency