https://github.com/vendicated/jsxml
XML-like object creation via JSX, because why the hell not!!
https://github.com/vendicated/jsxml
Last synced: about 1 year ago
JSON representation
XML-like object creation via JSX, because why the hell not!!
- Host: GitHub
- URL: https://github.com/vendicated/jsxml
- Owner: Vendicated
- Created: 2022-10-26T17:46:18.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-10-26T18:01:38.000Z (over 3 years ago)
- Last Synced: 2025-02-09T16:38:09.379Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 3.91 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# JsxML
XML-like object creation via JSX, because why the hell not!!
## How do I use this?
Clone, edit index.jsx and run via
```sh
npm i
node run.mjs
```
## Example
```jsx
// jsx doesn't support @ in the tag? criiinge
const TypesNode = "@types/node";
console.log(
<>
JsxML
XML-like object creation via JSX
1.0.0
{/* If you want this as Number, mark it as num */}
42
{/* Or maybe run some js? */}
return Math.random() * 42;
{/* Automatically inferred as Array since authors is the plural of author */}
Vendicated
{/* Since this has no children, array type cannot be inferred. specify it manualy */}
^0.15.12
18.11.6
>
);
```
When you compile and run it, you get
```js
{
name: 'JsxML',
description: 'XML-like object creation via JSX',
version: '1.0.0',
SomeNumber: 42,
scriptRes: 30.36912272363861,
authors: [ { name: 'Vendicated' } ],
keywords: [],
dependencies: { esbuild: '^0.15.12' },
devDependencies: { '@types/node': '18.11.6' }
}
```
## Why?????
Why not 
## Should I use this?
Absolutely, this is the most useful javascript library ever made