@wever/jsx-plugin

1.0.3 • Public • Published

JSX-PLUGIN

This is a Babel-Plugin to convert JSX code to Wever's XSET(Xeon-Stack-Element-Tree) Object Model.

export default function App (props) {

      return (
            <div className="container" id="first-div" style={style.container}>
                  <h1 style={{ color: "#fff", backgroundColor: "#000" }}>Hello World</h1>
                  <h1>My name is Arif Sardar</h1>
            </div>
      );
}

Converts into :

export default function App(props) {
      return {
            "name": "div",
            "props": {
                  "attributes": {
                        "className": "container",
                        "id": "first-div",
                        "style": style.container
                  },
                  "children": [{
                        "name": "h1",
                        "props": {
                              "attributes": {
                                    "style": {
                                          color: "#fff",
                                          backgroundColor: "#000"
                                    }
                              },
                              "children": ["Hello World"]
                        }
                  }, {
                        "name": "h1",
                        "props": {
                              "attributes": {},
                              "children": ["My name is Arif Sardar"]
                        }
                  }]
            }
      };
}

Dependents (0)

Package Sidebar

Install

npm i @wever/jsx-plugin

Weekly Downloads

0

Version

1.0.3

License

MIT

Unpacked Size

38.5 kB

Total Files

9

Last publish

Collaborators

  • code_with_arif