@lek-js/xmlx
v1.0.2
Published
create xml with jsx
Readme
XMLX
This package allows you to create XML strings using a simple JSX-like syntax:
npm i xmlx//my-xml.js
import Xmlx from "@lek-js/xmlx";
const Word = ({children}) => <a-tag>{children}</a-tag>
const xml = <my-tag>
<Word>Hello</Word>
<Word>World</Word>
</my-tag>
console.log(xml);//my-builder.js
const buildXmlx = require("@lek-js/xmlx/builder");
buildXmlx("./my-xml.js", "bundle.js");Then you can execute the bundle and generate the XML you need.
node my-builder #to compile
node bundle.js #to executeThis package supports working with fragments and arrays, which can be useful for creating components to simplify SVG or other formats.
