# @stein197/jsxml

> XML generator

Latest version **0.1.0** (published 2023-02-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install @stein197/jsxml
pnpm add @stein197/jsxml
yarn add @stein197/jsxml
bun add @stein197/jsxml
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2023-02-11 |
| First published | 2023-02-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 199.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Nail' Gafarov |
| Maintainers | stein197 |
| Keywords | xml, html |

## Links

- npm: https://www.npmjs.com/package/@stein197/jsxml
- Repository: https://github.com/stein197/jsxml
- Homepage: https://github.com/stein197/jsxml#readme
- Issues: https://github.com/stein197/jsxml/issues
- npm.io page: https://npm.io/package/@stein197/jsxml

## Dependencies (1)

- [@stein197/ts-util](https://npm.io/package/@stein197/ts-util.md) ^1.10.0

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2023-02-11

## README

# JSXML

```
npm install @stein197/jsxml
```

```ts
import jsxml from "@stein197/jsxml";

const xml = jsxml(b => {
	b.e("html", {lang: "en"}, b => {
		b.e("head", b => {
			b.e("meta", {charset: "UTF-8"});
			b.e("meta", {"http-equiv": "X-UA-Compatible", content: "IE=edge"});
			b.e("meta", {name: "viewport", content: "width=device-width, initial-scale=1.0"});
			b.e("title", "Document");
		});
		b.e("body");
	});
});

// Or use methods corresponding to tha tag names. HTML, SVG and MathML tags are supported
const xml = jsxml(_ => {
	_.html({lang: "en"}, _ => {
		_.head();
		_.body();
	});
});

// And then stringify it...
console.log(xml.stringify({mode: "xml", output: "prettified"}));
// ...or return DOM structure
document.body.append(xml.dom());
```

## NPM scripts
- `clean` - deletes compiled files
- `build` - compiles TypeScript source code
- `test` - runs unit tests

---
_Source: https://npm.io/package/@stein197/jsxml · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
